Get EQL search results
- POST also GET /{index}/_eql/search
Returns search results for an Event Query Language (EQL) query. EQL assumes each document in a data stream or index corresponds to an event.
Learn more about EQLPath Parameters
-
indexIndexName | IndexNamerequired -
Comma-separated list of index names to scope the operation
Query Parameters
-
allow_no_indicesboolean · default: true A setting that does two separate checks on the index expression. If
false, the request returns an error (1) if any wildcard expression (including_alland*) resolves to zero matching indices or (2) if the complete set of resolved indices, aliases or data streams is empty after all expressions are evaluated. Iftrue, index expressions that resolve to no indices are allowed and the request returns an empty result.-
allow_partial_search_resultsboolean · default: true If true, returns partial results if there are shard failures. If false, returns an error with no partial results.
-
allow_partial_sequence_resultsboolean · default: false If true, sequence queries will return partial results in case of shard failures. If false, they will return no results at all. This flag has effect only if allow_partial_search_results is true.
-
expand_wildcardsstring ExpandWildcards · default: open Whether to expand wildcard expression to concrete indices that are open, closed or both.
Supported values include:
all: Match any data stream or index, including hidden ones.open: Match open, non-hidden indices. Also matches any non-hidden data stream.closed: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.hidden: Match hidden data streams and hidden indices. Must be combined withopen,closed, orboth.none: Wildcard expressions are not accepted.
-
Values:
allopenclosedhiddennone -
ccs_minimize_roundtripsboolean · default: true Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
If
false, the request returns an error if it targets a concrete (non-wildcarded) index, alias, or data stream that is missing, closed, or otherwise unavailable. Iftrue, unavailable concrete targets are silently ignored.-
keep_alivestring Duration · default: 5d Period for which the search and its results are stored on the cluster.
-
keep_on_completionboolean · default: false If true, the search and its results are stored on the cluster.
-
wait_for_completion_timeoutstring Duration Timeout duration to wait for the request to finish. Defaults to no timeout, meaning the request waits for complete search results.
Request
-
querystringrequired -
EQL query you wish to run.
-
case_sensitiveboolean -
event_category_fieldstring Field · default: event.category -
Field containing the event classification, such as process, file, or network.
-
tiebreaker_fieldstring Field -
Field used to sort hits with the same timestamp in ascending order
-
timestamp_fieldstring Field · default: @timestamp -
Field containing event timestamp.
-
fetch_sizenumber uint · default: 1000 -
Maximum number of events to search at a time for sequence queries.
-
filteroneOf -
Query, written in Query DSL, used to filter the events on which the EQL query runs.
-
keep_alivestring Duration -
keep_on_completionboolean -
wait_for_completion_timeoutstring Duration -
allow_partial_search_resultsboolean · default: true -
Allow query execution also in case of shard failures. If true, the query will keep running and will return results based on the available shards. For sequences, the behavior can be further refined using allow_partial_sequence_results
-
allow_partial_sequence_resultsboolean · default: false -
This flag applies only to sequences and has effect only if allow_partial_search_results=true. If true, the sequence query will return results based on the available shards, ignoring the others. If false, the sequence query will return successfully, but will always have empty results.
-
sizenumber uint -
For basic queries, the maximum number of matching events to return. Defaults to 10
-
fieldsoneOf -
Array of wildcard (*) patterns. The response returns values for field names matching these patterns in the fields property of each hit.
-
fieldstring Fieldrequired -
A wildcard pattern. The request returns values for field names matching this pattern.
-
formatstring -
The format in which the values are returned.
-
include_unmappedboolean -
result_positionResultPosition · default: tail -
Supported values include:
tail: Return the most recent matches, similar to the Unix tail command.head: Return the earliest matches, similar to the Unix head command.
-
Values:
tailhead -
runtime_mappingsRuntimeFields -
max_samples_per_keynumber · default: 1 -
By default, the response of a sample query contains up to
10samples, with one sample per unique set of join keys. Use thesizeparameter to get a smaller or larger set of samples. To retrieve more than one sample per set of join keys, use themax_samples_per_keyparameter. Pipes are not supported for sample queries.
Response
-
idstring Id -
Identifier for the search.
-
is_partialboolean -
If true, the response does not contain complete search results.
-
is_runningboolean -
If true, the search request is still executing.
-
tookDurationValueUnitMillis -
Milliseconds it took Elasticsearch to execute the request.
-
timed_outboolean -
If true, the request timed out before completion.
-
hitsEqlHitsrequired -
Contains matching events and sequences. Also contains related metadata.
-
totalTotalHits -
Metadata about the number of matching events or sequences.
-
eventsHitsEvent -
Contains events matching the query. Each object represents a matching event.
-
_indexstring IndexNamerequired -
Name of the index containing the event.
-
_idstring Idrequired -
Unique identifier for the event. This ID is only unique within the index.
-
_sourceobjectrequired -
Original JSON body passed for the event at index time.
-
missingboolean -
Set to
truefor events in a timespan-constrained sequence that do not meet a given condition. -
fieldsmap string to object -
sequencesHitsSequence -
Contains event sequences matching the query. Each object represents a matching sequence. This parameter is only returned for EQL queries containing a sequence.
-
eventsHitsEventrequired -
Contains events matching the query. Each object represents a matching event.
-
_indexstring IndexNamerequired -
Name of the index containing the event.
-
_idstring Idrequired -
Unique identifier for the event. This ID is only unique within the index.
-
_sourceobjectrequired -
Original JSON body passed for the event at index time.
-
missingboolean -
Set to
truefor events in a timespan-constrained sequence that do not meet a given condition. -
fieldsmap string to object -
join_keysobject -
Shared field values used to constrain matches in the sequence. These are defined using the by keyword in the EQL query syntax.
-
shard_failuresShardFailure -
Contains information about shard failures (if any), in case allow_partial_search_results=true
-
indexstring IndexName -
nodestring -
reasonErrorCauserequired -
typestringrequired -
The type of error
-
reasonstringnullable -
A human-readable explanation of the error, in English.
-
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byErrorCause -
root_causeErrorCause -
suppressedErrorCause -
shardnumber -
statusstring -
primaryboolean