Skip to content

Commit c6334ee

Browse files
authored
[DOCS] Document any keyword in EQL syntax (elastic#52821)
* [DOCS] Document `any` keyword in EQL syntax Adds documentation for the `any` keyword to the EQL syntax docs. Includes: * Definition of an event type and its relationship to the event type field. * Example matching all event types using `any` keyword * Example matching event types beginning with a digit * Example using `any` with `where true` * Remove references to `event_type_field` default * Reuse "Events starting with digits" section * Updates for elastic#53073
1 parent fc07dc8 commit c6334ee

File tree

1 file changed

+51
-6
lines changed

1 file changed

+51
-6
lines changed

docs/reference/eql/syntax.asciidoc

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,45 @@ experimental::[]
1414
[[eql-basic-syntax]]
1515
=== Basic syntax
1616

17-
EQL queries require an event type and a matching condition. The `where` keyword connects them.
17+
EQL queries require an event category and a matching condition. The `where`
18+
keyword connects them.
1819

1920
[source,eql]
2021
----
21-
event.category where condition
22+
event_category where condition
2223
----
2324

24-
For example, the following EQL query matches `process` events with a `process.name`
25-
field value of `svchost.exe`:
25+
For example, the following EQL query matches `process` events with a
26+
`process.name` field value of `svchost.exe`:
2627

2728
[source,eql]
2829
----
2930
process where process.name == "svchost.exe"
3031
----
3132

33+
[discrete]
34+
[[eql-syntax-event-categories]]
35+
==== Event categories
36+
37+
In {es}, an event category is a valid, indexed value of the
38+
<<eql-required-fields,event category field>>. You can set the event category
39+
field using the `event_category_field` parameter of the EQL search API.
40+
41+
[discrete]
42+
[[eql-syntax-match-any-event-category]]
43+
===== Match any event category
44+
45+
To match events of any category, use the `any` keyword. You can also use the
46+
`any` keyword to search for documents without a event category field.
47+
48+
For example, the following EQL query matches any documents with a
49+
`network.protocol` field value of `http`:
50+
51+
[source,eql]
52+
----
53+
any where network.protocol == "http"
54+
----
55+
3256
[discrete]
3357
[[eql-syntax-conditions]]
3458
==== Conditions
@@ -159,7 +183,7 @@ Strings are enclosed with double quotes (`"`) or single quotes (`'`).
159183

160184
[discrete]
161185
[[eql-syntax-wildcards]]
162-
===== Wildcards
186+
===== Wildcards
163187

164188
You can use the wildcard operator (`*`) within a string to match specific
165189
patterns. You can use wildcards with the `==` (equal) or `!=` (not equal)
@@ -171,9 +195,30 @@ field == "example*wildcard"
171195
field != "example*wildcard"
172196
----
173197

198+
[discrete]
199+
[[eql-syntax-match-any-condition]]
200+
===== Match any condition
201+
202+
To match events solely on event category, use the `where true` condition.
203+
204+
For example, the following EQL query matches any `file` events:
205+
206+
[source,eql]
207+
----
208+
file where true
209+
----
210+
211+
To match any event, you can combine the `any` keyword with the `where true`
212+
condition:
213+
214+
[source,eql]
215+
----
216+
any where true
217+
----
218+
174219
[discrete]
175220
[[eql-syntax-escaped-characters]]
176-
===== Escaped characters
221+
===== Escaped characters
177222

178223
When used within a string, special characters, such as a carriage return or
179224
double quote (`"`), must be escaped with a preceding backslash (`\`).

0 commit comments

Comments
 (0)