Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] EQL: Document length function #54225

Merged
merged 2 commits into from
Apr 1, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions docs/reference/eql/functions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,50 @@ experimental::[]

{es} supports the following EQL functions:

* <<eql-fn-length>>
* <<eql-fn-substring>>

[discrete]
[[eql-fn-length]]
=== `length`

Returns the character length of a provided string, including whitespace and
punctuation.

[%collapsible]
====
*Example*
[source,eql]
----
length("explorer.exe") // returns 12
length("start explorer.exe") // returns 18
length("") // returns 0
length(null) // returns null

// process.name = "regsvr32.exe"
length(process.name) // returns 12
----

*Syntax*
[source,txt]
----
length(<string>)
----

*Parameters*

`<string>`::
(Required, string or `null`)
String for which to return the character length. If `null`, the function returns
`null`. Empty strings return `0`.
+
If using a field as the argument, this parameter only supports the
<<keyword,`keyword`>> and <<constant-keyword,`constant_keyword`>> field
datatypes. <<array,Array values>> are not supported.

*Returns:* integer or `null`
====

[discrete]
[[eql-fn-substring]]
=== `substring`
Expand Down