Filters events from the input array using the function provided in the array.

The order is maintained in the output array.

ParameterTypeRequiredDefault ValueDescription
array[a]stringrequired   A string in the format of a valid array followed by []. A valid array can either be an identifier, a valid array followed by . and an identifier, or a valid array followed by an array index surrounded by square brackets. For example, for events with fields incidents[0], incidents[1], ... this would be incidents[] .
asArraystringoptional[b]   The output array. Defaults to the value passed to the array parameter.
functionnon-aggregate functionrequired   The function to use for filtering events in the array.
varstringrequired 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

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

Deduplicate Compound Field Data With array:union() and split()

Filter an Array on a Given Condition

Filter the elements of a flat array on a given condition using the array filter function array:filter()