Skip to content
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
52 changes: 52 additions & 0 deletions docs/reference/eql/functions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ experimental::[]

* <<eql-fn-between>>
* <<eql-fn-cidrmatch>>
* <<eql-fn-concat>>
* <<eql-fn-endswith>>
* <<eql-fn-indexof>>
* <<eql-fn-length>>
Expand Down Expand Up @@ -180,6 +181,57 @@ CIDR block you wish to search. If `null`, the function returns `null`.
*Returns:* boolean or `null`
====

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

Returns a concatenated string of provided values.

[%collapsible]
====
*Example*
[source,eql]
----
concat("process is ", "regsvr32.exe") // returns "process is regsvr32.exe"
concat("regsvr32.exe", " ", 42) // returns "regsvr32.exe 42"
concat("regsvr32.exe", " ", 42.5) // returns "regsvr32.exe 42.5"
concat("regsvr32.exe", " ", true) // returns "regsvr32.exe true"
concat("regsvr32.exe") // returns "regsvr32.exe"

// process.name = "regsvr32.exe"
concat(process.name, " ", 42) // returns "regsvr32.exe 42"
concat(process.name, " ", 42.5) // returns "regsvr32.exe 42.5"
concat("process is ", process.name) // returns "process is regsvr32.exe"
concat(process.name, " ", true) // returns "regsvr32.exe true"
concat(process.name) // returns "regsvr32.exe"

// process.arg_count = 4
concat(process.name, " ", process.arg_count) // returns "regsvr32.exe 4"

// null handling
concat(null, "regsvr32.exe") // returns null
concat(process.name, null) // returns null
concat(null) // returns null
----

*Syntax*
[source,txt]
----
concat(<value>[, <value>])
----

*Parameters*

`<value>`::
(Required{multi-arg-ref})
Value to concatenate. If `null`, the function returns `null`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong grasp on the verbiage for multi-arg-ref

Suggested change
Value to concatenate. If `null`, the function returns `null`.
Value to concatenate. If any of the arguments are `null`, the function returns `null`.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this clarification is good regardless. Thanks for adding.

The {multi-arg-ref} attribute creates a footnote link to the following text:

This parameter accepts multiple arguments.

Here's a screenshot from the wildcard function, which happens to be near the footnote at the bottom of the page.

Screen Shot 2020-05-05 at 4 24 47 PM

+
If using a field as the argument, this parameter does not support the
<<text,`text`>> field datatype.

*Returns:* string or `null`
====

[discrete]
[[eql-fn-endswith]]
=== `endsWith`
Expand Down