Important
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.
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,...
.
Parameter | Type | Required | Default Value | Description |
---|---|---|---|---|
array [a] | string | required | 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[]", ... . | |
asArray | string | optional[b] | value passed to the array parameter | The output array. |
function | non-aggregate function | required | 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. | |
var | string | optional[b] | input array name | Name of the variable to be used in the function argument. |
[b] Optional parameters use their default value unless explicitly set. |
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