Skip to main content
The series_multiply function performs element-wise multiplication between two numeric dynamic arrays (series). Each element in the first series is multiplied by the corresponding element at the same position in the second series. You can use series_multiply when you need to scale time-series data, apply weights, or combine multiple metrics through multiplication. This is particularly useful for calculating weighted scores, applying normalization factors, or computing products of related measurements.

For users of other query languages

If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.
In Splunk SPL, you typically use the eval command with the multiplication operator to calculate products between fields. In APL, series_multiply operates on entire arrays at once, performing element-wise multiplication efficiently.
... | eval product=value1 * value2
In SQL, you multiply values using the * operator on individual columns. In APL, series_multiply performs element-wise multiplication across entire arrays stored in single columns.
SELECT value1 * value2 AS product
FROM measurements;

Usage

Syntax

series_multiply(series1, series2)

Parameters

ParameterTypeDescription
series1dynamicA dynamic array of numeric values.
series2dynamicA dynamic array of numeric values.

Returns

A dynamic array where each element is the result of multiplying the corresponding elements of series1 and series2. If the arrays have different lengths, the shorter array is extended with null values.

Use case examples

  • Log analysis
  • OpenTelemetry traces
  • Security logs
In log analysis, you can use series_multiply to apply weighting factors to request durations, calculating weighted performance metrics.Query
['sample-http-logs']
| summarize durations = make_list(req_duration_ms) by ['geo.city']
| extend weights = dynamic([1.0, 1.2, 0.8, 1.1, 0.9])
| extend weighted_durations = series_multiply(durations, weights)
| take 5
Run in PlaygroundOutput
geo.citydurationsweightsweighted_durations
Seattle[50, 60, 55, 58, 52][1.0, 1.2, 0.8, 1.1, 0.9][50, 72, 44, 63.8, 46.8]
Portland[45, 50, 48, 52, 47][1.0, 1.2, 0.8, 1.1, 0.9][45, 60, 38.4, 57.2, 42.3]
This query applies priority weights to request durations, emphasizing certain time periods or request types in performance analysis.
  • series_subtract: Performs element-wise subtraction of two series. Use when you need to subtract values instead of multiplying them.
  • series_pow: Raises series elements to a power. Use when you need exponentiation instead of multiplication.
  • series_sum: Returns the sum of all values in a series. Use to aggregate the results after multiplication.
  • series_abs: Returns absolute values of elements. Use when you need magnitude without direction.