Checks whether the given pattern matches any of the values of the array and excludes the event from the search result if it does not match on any value.
Note
To ensure compatibility, it is recommended to always test your regular expressions inside LogScale, instead of a 3rd party regex tool.
Parameter | Type | Required | Default Value | Description |
---|---|---|---|---|
array [a] | string | required | A string in the format of a valid array index [] . 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[] . | |
flags | string | optional[b] | The regex modifier flags to use. | |
Valid Values | ||||
| Empty String | |||
d | Period (.) also includes newline characters | |||
i | Ignore case for matched values | |||
m | Multi-line parsing of regular expressions | |||
regex | regex | required | The regex pattern for the value on which to search the array. | |
[b] Optional parameters use their default value unless explicitly set. |
A specific syntax applies for this query function, see Array Syntax for details.
array:regex()
Examples
Click
next to an example below to get the full details.Find Matches in Array Given a Regular Expression - Example 1
Use regular expressions to search for and match specific patterns in flat arrays
Find Matches in Array Given a Regular Expression - Example 2
Use regular expressions to search for and match specific patterns ignoring case in flat arrays