Skip to content

Commit be8ae97

Browse files
authored
[DOCS] Add basic EQL search tutorial docs (#51574)
I plan to add additional sections to this page with future PRs: * Specify timestamp and event type fields * Specify a join key field * Filter using query DSL * Paginate a large response See #51057.
1 parent 34734ae commit be8ae97

File tree

4 files changed

+50
-5
lines changed

4 files changed

+50
-5
lines changed

docs/reference/eql/index.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ Consider using EQL if you:
3030
=== In this section
3131

3232
* <<eql-requirements>>
33+
* <<eql-search>>
3334
* <<eql-syntax>>
3435

3536
include::requirements.asciidoc[]
37+
include::search.asciidoc[]
3638
include::syntax.asciidoc[]

docs/reference/eql/requirements.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<titleabbrev>Requirements</titleabbrev>
77
++++
88

9+
experimental::[]
10+
911
EQL is schemaless and works out-of-the-box with most common log formats. If you
1012
use a standard log format and already know what fields in your index contain
1113
event type and timestamp information, you can skip this page.

docs/reference/eql/search.asciidoc

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[role="xpack"]
2+
[testenv="basic"]
3+
[[eql-search]]
4+
== Run an EQL search
5+
6+
experimental::[]
7+
8+
To start using EQL in {es}, first ensure your event data meets
9+
<<eql-requirements,EQL requirements>>. Then ingest or add the data to an {es}
10+
index.
11+
12+
The following <<docs-bulk,bulk API>> request adds some example log data to the
13+
`sec_logs` index. This log data follows the {ecs-ref}[Elastic Common Schema
14+
(ECS)].
15+
16+
[source,console]
17+
----
18+
PUT sec_logs/_bulk?refresh
19+
{"index":{"_index" : "sec_logs"}}
20+
{ "@timestamp": "2020-12-07T11:06:07.000Z", "agent": { "id": "8a4f500d" }, "event": { "category": "process" }, "process": { "name": "cmd.exe", "path": "C:\\Windows\\System32\\cmd.exe" } }
21+
{"index":{"_index" : "sec_logs"}}
22+
{ "@timestamp": "2020-12-07T11:07:08.000Z", "agent": { "id": "8a4f500d" }, "event": { "category": "image_load" }, "file": { "name": "cmd.exe", "path": "C:\\Windows\\System32\\cmd.exe" }, "process": { "name": "cmd.exe", "path": "C:\\Windows\\System32\\cmd.exe" } }
23+
{"index":{"_index" : "sec_logs"}}
24+
{ "@timestamp": "2020-12-07T11:07:09.000Z", "agent": { "id": "8a4f500d" }, "event": { "category": "process" }, "process": { "name": "regsvr32.exe", "path": "C:\\Windows\\System32\\regsvr32.exe" } }
25+
----
26+
27+
You can now use the EQL search API to search this index using an EQL query.
28+
29+
The following request searches the `sec_logs` index using the EQL query
30+
specified in the `rule` parameter. The EQL query matches events with an
31+
`event.category` of `process` that have a `process.name` of `cmd.exe`.
32+
33+
[source,console]
34+
----
35+
GET sec_logs/_eql/search
36+
{
37+
"rule": """
38+
process where process.name == "cmd.exe"
39+
"""
40+
}
41+
----
42+
// TEST[continued]
43+
44+
Because the `sec_log` index follows the ECS, you don't need to specify the
45+
event type or timestamp fields. The request uses the `event.category` and
46+
`@timestamp` fields by default.

docs/reference/redirects.asciidoc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,3 @@ See <<slm-api-start>>.
365365
=== Stop {slm} API
366366

367367
See <<slm-api-stop>>.
368-
369-
[role="exclude",id="eql-search"]
370-
=== EQL search API
371-
372-
See <<eql>>.

0 commit comments

Comments
 (0)