Evaluates the function argument on all values in the array under the array argument overwriting the array. If the asArray argument is supplied, then array:eval() saves the result in an array under the given prefix. This overwrites existing arrays of that name.

The output array is always compacted, meaning that the array indices are guaranteed to be continuous, for example, 0,1,2,....

ParameterTypeRequiredDefault ValueDescription
array[a]stringrequired   The array name in LogScale Array Syntax, for example, for events with fields incidents[0], incidents[1], ... this would be incidents[], as in array:eval(array="incidents[]", ....
asArraystringoptional[b] value passed to the array parameter The output array.
functionnon-aggregate functionrequired   The function to be applied to each element of the array. Must write a value to a field named the same as the output array.
varstringoptional[b] input array name Name of the variable to be used in the function argument.

[a] The parameter name array can be omitted.

[b] Optional parameters use their default value unless explicitly set.

Hide omitted argument names for this function

Show omitted argument names for this function

array:eval() Examples

Click + next to an example below to get the full details.

Evaluate Function Argument on Values in Array

Evaluate the function argument on all values in a flat array

Perform Formatting on All Values in an Array

Perform formatting on all values in a flat array using the array:eval() function

Square Values in an Array

Square values in an array using the array:eval() function