2020-06-30 09:12:54 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="basic"]
|
|
|
|
[[eql-pipe-ref]]
|
|
|
|
== EQL pipe reference
|
|
|
|
++++
|
|
|
|
<titleabbrev>Pipe reference</titleabbrev>
|
|
|
|
++++
|
|
|
|
|
2020-07-13 09:04:15 -04:00
|
|
|
experimental::[]
|
2020-06-30 09:12:54 -04:00
|
|
|
|
|
|
|
{es} supports the following EQL pipes:
|
|
|
|
|
|
|
|
* <<eql-pipe-head>>
|
|
|
|
* <<eql-pipe-tail>>
|
|
|
|
|
|
|
|
[discrete]
|
|
|
|
[[eql-pipe-head]]
|
|
|
|
=== `head`
|
|
|
|
|
2020-07-08 12:22:57 -04:00
|
|
|
Returns up to a specified number of events or sequences, starting with the
|
|
|
|
earliest matches. Works similarly to the
|
2020-06-30 09:12:54 -04:00
|
|
|
https://en.wikipedia.org/wiki/Head_(Unix)[Unix head command].
|
|
|
|
|
|
|
|
[%collapsible]
|
|
|
|
====
|
|
|
|
*Example*
|
|
|
|
|
2020-07-08 12:22:57 -04:00
|
|
|
The following EQL query returns up to three of the earliest powershell
|
2020-06-30 09:12:54 -04:00
|
|
|
commands.
|
|
|
|
|
|
|
|
[source,eql]
|
|
|
|
----
|
|
|
|
process where process.name == "powershell.exe"
|
2020-07-08 12:22:57 -04:00
|
|
|
| head 3
|
2020-06-30 09:12:54 -04:00
|
|
|
----
|
|
|
|
|
|
|
|
*Syntax*
|
|
|
|
[source,txt]
|
|
|
|
----
|
|
|
|
head <max>
|
|
|
|
----
|
|
|
|
|
|
|
|
*Parameters*
|
|
|
|
|
|
|
|
`<max>`::
|
|
|
|
(Required, integer)
|
2020-07-08 12:22:57 -04:00
|
|
|
Maximum number of matching events or sequences to return.
|
2020-06-30 09:12:54 -04:00
|
|
|
====
|
|
|
|
|
|
|
|
[discrete]
|
|
|
|
[[eql-pipe-tail]]
|
|
|
|
=== `tail`
|
|
|
|
|
2020-07-08 12:22:57 -04:00
|
|
|
Returns up to a specified number of events or sequences, starting with the most
|
|
|
|
recent matches. Works similarly to the
|
2020-06-30 09:12:54 -04:00
|
|
|
https://en.wikipedia.org/wiki/Tail_(Unix)[Unix tail command].
|
|
|
|
|
|
|
|
[%collapsible]
|
|
|
|
====
|
|
|
|
*Example*
|
|
|
|
|
2020-07-08 12:22:57 -04:00
|
|
|
The following EQL query returns up to five of the most recent `svchost.exe`
|
2020-06-30 09:12:54 -04:00
|
|
|
processes.
|
|
|
|
|
|
|
|
[source,eql]
|
|
|
|
----
|
|
|
|
process where process.name == "svchost.exe"
|
2020-07-08 12:22:57 -04:00
|
|
|
| tail 5
|
2020-06-30 09:12:54 -04:00
|
|
|
----
|
|
|
|
|
|
|
|
*Syntax*
|
|
|
|
[source,txt]
|
|
|
|
----
|
|
|
|
tail <max>
|
|
|
|
----
|
|
|
|
|
|
|
|
*Parameters*
|
|
|
|
|
|
|
|
`<max>`::
|
|
|
|
(Required, integer)
|
2020-07-08 12:22:57 -04:00
|
|
|
Maximum number of matching events or sequences to return.
|
|
|
|
====
|