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 an as argument has been supplied, array:eval() will save the result in an array under the supplied prefix. This overwrites existing arrays of that name.

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[b]  The name of the output array. Default is to use the same as the input array.
functionstringrequired  The function to be applied to each element of the array.
varstringrequired  Name of the variable to be used in function argument.

[a] The argument name array can be omitted.

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

Omitted Argument Names

The argument name for array can be omitted; the following forms of this function are equivalent:




These examples show basic structure only; full examples are provided below.

array:eval() Examples

To square the value of each item in the array:

values = [2,3,4]

Use the following query function:

array:eval(values, as=squared, var="x", function={x := x*x})

The expected output:

squared = [4, 9, 16]