Skip to content

Commit e94c2c5

Browse files
authored
[DOCS] EQL: Add filter_path param to EQL search API docs (#68537) (#68544)
1 parent f3ffe7f commit e94c2c5

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

docs/reference/eql/eql-search-api.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
8282
+
8383
Defaults to `open`.
8484

85+
`filter_path`::
86+
(Optional, string)
87+
Comma-separated list of filters for the API response. See
88+
<<common-options-response-filtering>>.
89+
8590
`ignore_unavailable`::
8691
(Optional, Boolean) If `true`, missing or closed indices are not included in the
8792
response. Defaults to `true`.

docs/reference/eql/eql.asciidoc

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,49 @@ GET /my-index-000001/_eql/search
136136
----
137137
// TEST[setup:sec_logs]
138138

139+
Use the <<common-options-response-filtering,`filter_path`>> query parameter to
140+
filter the API response. For example, the following search returns only the
141+
timestamp and PID for each matching event.
142+
143+
[source,console]
144+
----
145+
GET /my-index-000001/_eql/search?filter_path=hits.events._source.@timestamp,hits.events._source.process.pid
146+
{
147+
"query": """
148+
process where process.name == "regsvr32.exe"
149+
"""
150+
}
151+
----
152+
// TEST[setup:sec_logs]
153+
154+
The API returns the following response.
155+
156+
[source,console-result]
157+
----
158+
{
159+
"hits" : {
160+
"events" : [
161+
{
162+
"_source" : {
163+
"@timestamp" : "2099-12-07T11:07:09.000Z",
164+
"process" : {
165+
"pid" : 2012
166+
}
167+
}
168+
},
169+
{
170+
"_source" : {
171+
"@timestamp" : "2099-12-07T11:07:10.000Z",
172+
"process" : {
173+
"pid" : 2012
174+
}
175+
}
176+
}
177+
]
178+
}
179+
}
180+
----
181+
139182
[discrete]
140183
[[eql-search-sequence]]
141184
=== Search for a sequence of events

0 commit comments

Comments
 (0)