[[eql-function-ref]]
== EQL function reference
++++
Function reference
++++
experimental::[]
{es} supports the following EQL functions:
* <>
* <>
* <>
* <>
* <>
* <>
* <>
* <>
* <>
* <>
* <>
* <>
* <>
* <>
* <>
* <>
* <>
* <>
[discrete]
[[eql-fn-add]]
=== `add`
Returns the sum of two provided addends.
[%collapsible]
====
*Example*
[source,eql]
----
add(4, 5) // returns 9
add(4, 0.5) // returns 4.5
add(0.5, 0.25) // returns 0.75
add(4, -2) // returns 2
add(-2, -2) // returns -4
// process.args_count = 4
add(process.args_count, 5) // returns 9
add(process.args_count, 0.5) // returns 4.5
// process.parent.args_count = 2
add(process.args_count, process.parent.args_count) // returns 6
// null handling
add(null, 4) // returns null
add(4. null) // returns null
add(null, process.args_count) // returns null
add(process.args_count null) // returns null
----
*Syntax*
[source,txt]
----
add(, )
----
*Parameters:*
``::
(Required, integer or float or `null`)
Addend to add. If `null`, the function returns `null`.
+
Two addends are required. No more than two addends can be provided.
+
If using a field as the argument, this parameter supports only
<> field datatypes.
*Returns:* integer, float, or `null`
====
[discrete]
[[eql-fn-between]]
=== `between`
Extracts a substring that's between a provided `left` and `right` text in a
source string.
[%collapsible]
====
*Example*
[source,eql]
----
// file.path = "C:\\Windows\\System32\\cmd.exe"
between(file.path, "system32\\\\", ".exe") // returns "cmd"
between(file.path, "workspace\\\\", ".exe") // returns ""
// Greedy matching defaults to false.
between(file.path, "\\\\", "\\\\", false) // returns "Windows"
// Sets greedy matching to true
between(file.path, "\\\\", "\\\\", true) // returns "Windows\\System32"
// Case sensitivity defaults to false.
between(file.path, "system32\\\\", ".exe", false, false) // returns "cmd"
// Sets case sensitivity to true
between(file.path, "system32\\\\", ".exe", false, true) // returns ""
between(file.path, "System32\\\\", ".exe", false, true) // returns "cmd"
// empty source string
between("", "system32\\\\", ".exe") // returns ""
between("", "", "") // returns ""
// null handling
between(null, "system32\\\\", ".exe") // returns null
----
*Syntax*
[source,txt]
----
between(