This function is considered experimental and under active development and should not be used in production.

The function must be enabled using the feature flag ArrayFunctions. See Enabling & Disabling Feature Flags.

Computes an aggregate value for each array element with the same index.

If, for example, all events contain arrays with the time taken for 3 different tasks,

array:reduceColumn(times, var=x,function=[avg(x), max(x)])

will compute the maximum and average time for each task.

If function is an aggregator that produces more than one event, such as groupBy(), the output of array:reduceColumn() will contain the same number of events as the maximum number of events produced in a column. The n'th event will contain an array with the values from the n'th event in all columns having an n'th event. This can lead to unreliable ordering of the output if the internal aggregate does not output ordered events (such as groupBy()).

Function Traits: Aggregate

array[a]stringrequired  The prefix of the array in LogScale, for example for events with fields incidents[0], incidents[1], ... this would be incidents.
asstringoptional  Name of the output array.
functionstringrequired  Aggregate function to use (for example max()).
varstringrequired  Placeholder field name to use for array elements in the aggregate function.

[a] The argument name array can be omitted.

The parameter name for array can be omitted; the following forms are equivalent:




Find the maximum time for each place in the array. Given two events with arrays:

times=[1, 2, 3]
times=[5, 1, 0]

with the function:

maxTimes := array:reduceColumn(times, var=x, function={time := max(x)})

the result would be:

maxTimes[0].time = 5
maxTimes[1].time = 2
maxTimes[2].time = 3