Predefined ECL Functions
- String functions
- List functions
- Conditional functions
- Smart List functions
- Conversion functions
- Miscellaneous functions
Function Name | Arguments | Returns |
---|---|---|
IIF | Condition, then, else | Returns the 'Then' value if condition is true, otherwise it should return the 'Else' value.
For example: IIF(true, “a”, “b”) returns “a” IIF(false, ”a”,”b”) returns “b” |
Function Name | Arguments | Returns |
---|---|---|
lookup | (String 1, String 2) | The value associated with String2 in the smart list named String1. |
isInList | (String 1, String 2) | True if the value String2 is defined in smart list named String1. |
Function Name | Arguments | Returns |
---|---|---|
ToTimestamp | (expression, formatString) or (expression, formatString, timezone) or (expression, formatString, timezone, defaultValue) | The expression, which should evaluate to a string, is interpreted as a time according to the supplied formatString. If the conversion fails, null is returned, unless a default string is provided, which is interpreted as a time and returned. |
ToIP | (expression_ or (expression, defaultValue) | Convert the expression to an IP address (Java InetAddress). If the conversion fails, null is returned, unless a default string is provided, which is interpreted as an IP address and returned. |
ToTimestampString | (expression, formatString) or (expression, formatString, timezone) or (expression, formatString, timezone, defaultValue) | Same as ToTimestamp, except the conversion is in the opposite direction to get a printable timestamp. |
ToInt | (expression) or (expression, defaultValue) | The obvious conversion to integer with default value taken if not convertible. |
ToLong | (expression) or (expression, defaultValue) | The obvious conversion to Long with default value taken if not convertible. |
ToString | (expression) or (expression, defaultValue) | The obvious conversion to String with default value taken if not convertible.
Note: Using the ToString() function in a correlation Blok might result in inconsistent time format. Therefore, use the
ToTimestamp() function instead.
|
ToFloat | (expression) or (expression, defaultValue) | The obvious conversion to Float with default value taken if not convertible. |
ToBool | (expression) or (expression, defaultValue) | The obvious conversion to Boolean with default value taken if not convertible. |
ToDouble | (expression) or (expression, defaultValue) | The obvious conversion to Double with default value taken if not convertible. |
ExtractJson | (expression, extraction path) or (expression, extraction path, default value) | The expression, which is a JSON string is parsed. A field is extracted from the expression using the extraction path. If either the extpression or the path are invalid, an optional default value is returned. |
ExtractKvp | (expression, extraction path) or (expression, extraction path, nested KVP delimiters /default "{}"/) or (expression, extraction path, nested KVP, delimiter / default ","/) or (expression, extraction path, nested KVP, delimiter, separator /default "="/) or (expression, extraction path, nested KVP, delimiter, separator, escape character / default "\\"/) or (expression, extraction path, nested KVP, delimiter, separator, escape character, default value) | The expression, which is a nested KVP string is parsed. A field is extracted from the expression using the extraction path. If either the expression or the path are invalid, an optional default value is returned. |
Function Name | Arguments | Returns |
---|---|---|
matchcidr
You can use the function within SQL, EQL, and ECL queries, and in turn, in other functionality that make use of these queries. |
(IP_string_format, IP_address_to_Match, key)
In the IP_string_format parameter, you can specify a CIDR address, single IPv4 or IPv6 address, a comma-separated list of CIDR IP addresses or a range, a hyphen-separated range of IP addresses, or an enrichment list. In the IP_address_to_Match field, specify the column name from the logs, which are to be matched against the IP_string_format parameter. The data type of the column must be INET_ADDR. The key parameter specifies a key name in the enrichment list. The key parameter is mandatory when using this function in correlation bloks. You must provide a either key name or an empty string (""). |
Returns those IP addresses from the IP_address_to_Match parameter, which belong to the IP addresses specified in the IP_string_format list. |
Having Clause
The Having clause adds additional constraints on the events that have passed the filter and are grouped by the rule.
At (Least | Most) <integer> Distinct <expression> As <identifier> Limit <integer> Count Of <expression> Being <expression> (Greater | Less) Than <integer> Percentage Of <expression> Being <expression> (Greater | Less) Than <integer> %<condition>
The supported parameters are:
Parameter | Description |
---|---|
Count Of | Counts the number of time two expressions are equals and check that this value is greater or less than a boundary. |
Percentage Of | Counts the number of time two expressions are equals and make a ratio of this count versus the number of events in the group, then check whether the value is less or more than a value expressed as percent. |
The Having clause can also be an expression using aggregation functions and resolving to a Boolean.