Concatenates the values of all fields with the same name and an array suffix into a value in a new field. Such array fields typically come as output from either parseJson() or splitString().

All array fields starting with index from and ending with index to are selected. If some index is missing, the concatenation stops with the previous index, thus if only index 0, 1 and 3 are present, only index 0 and 1 are concatenated. If the first index is missing, no field is added to the event.

Function Traits: FieldComputationFunction, Transformation

ParameterTypeRequiredDefaultDescription
asstringoptional_concatArray Name of output field.
field[a]stringrequired  Base name for array fields to concatenate.
fromnumberoptional0 First array index to include [0..∞].
prefixstringoptional  Prefix to prepend to the generated string.
separatorstringoptional  Separator between values.
suffixstringoptional  Suffix to append to the generated string.
tonumberoptional  Last array index to include (leave out to get all). Must be equal to or larger than from.

[a] The argument name field can be omitted.

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

logscale
concatArray("value")

and:

logscale
concatArray(field="value")

concatArray() Examples

Concatenate the values of fields server[0], server[1] and so on and put it into a new field named _concatArray.

logscale
concatArray(server)

Put the result into a field named servers.

logscale
concatArray(server, as=servers)

Select only fields with indexes 1 to 3.

logscale
concatArray(server, from=1, to=3)

Add a separator between concatenated values.

logscale
concatArray(server, separator=", ")

Add a prefix and suffix to the generated string.

logscale
concatArray(server, prefix="[", suffix="]")