This function removes duplicate values from an array. The ordering of the first occurrence of each unique element is preserved.
Hide omitted argument names for this functionShow omitted argument names for this function
For instance, given a rawstring with array a[]:
Raw Events
{ "a":["horse", "fish", "horse", "cow", "cow"] } |
Specify the name of the array field from which to remove duplicates:
logscale
parseJson()
| array:dedup("a[]")
The duplicate item will be removed:
a[0] | a[1] | a[2] |
---|---|---|
horse | fish | cow |
array:dedup()
Examples
Click
next to an example below to get the full details.Deduplicate Values in Array
Remove duplicate values in an array using array:dedup()