事件查询语言(EQL)

class elasticsearch.client.EqlClient

To use this client, access client.eql from an Elasticsearch client. For example:

from elasticsearch import Elasticsearch

# Create the client instance
client = Elasticsearch(...)
# Use the eql client
client.eql.<method>(...)
delete(*, id, error_trace=None, filter_path=None, human=None, pretty=None)

删除异步EQL搜索。 删除一个异步EQL搜索或存储的同步EQL搜索。 该API还会删除该搜索的结果。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-delete

Parameters:
  • id (str) – 要删除的搜索标识符。异步搜索的EQL搜索API响应中会提供搜索ID。 如果请求的`keep_on_completion`参数为`true`,也会提供搜索ID。

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get(*, id, error_trace=None, filter_path=None, human=None, keep_alive=None, pretty=None, wait_for_completion_timeout=None)

获取异步EQL搜索结果。 获取异步EQL搜索或存储的同步EQL搜索的当前状态和可用结果。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-get

Parameters:
  • id (str) – 搜索标识符。

  • keep_alive (str | Literal[-1] | ~typing.Literal[0] | None) – 搜索及其结果在集群上存储的时长。默认为搜索的EQL搜索API请求设置的keep_alive值。

  • wait_for_completion_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待请求完成的超时时长。默认为无超时,意味着请求会等待完整的搜索结果。

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get_status(*, id, error_trace=None, filter_path=None, human=None, pretty=None)

获取异步EQL状态。 获取异步EQL搜索或存储的同步EQL搜索的当前状态,但不返回结果。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-get-status

Parameters:
Return type:

ObjectApiResponse[Any]

search(*, index, query=None, allow_no_indices=None, allow_partial_search_results=None, allow_partial_sequence_results=None, case_sensitive=None, ccs_minimize_roundtrips=None, error_trace=None, event_category_field=None, expand_wildcards=None, fetch_size=None, fields=None, filter=None, filter_path=None, human=None, ignore_unavailable=None, keep_alive=None, keep_on_completion=None, max_samples_per_key=None, pretty=None, result_position=None, runtime_mappings=None, size=None, tiebreaker_field=None, timestamp_field=None, wait_for_completion_timeout=None, body=None)

获取EQL搜索结果。 返回事件查询语言(EQL)查询的搜索结果。 EQL假设数据流或索引中的每个文档对应一个事件。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-search

Parameters:
  • index (str | Sequence[str]) – 限定操作范围的索引名称

  • query (str | None) – 要运行的EQL查询。

  • allow_no_indices (bool | None) – 是否忽略通配符索引表达式未解析到具体索引的情况。(包括`_all`字符串或未指定索引时)

  • allow_partial_search_results (bool | None) – 是否在分片失败时也允许查询执行。如果为true,查询将继续运行并基于可用分片返回结果。对于序列,可以使用allow_partial_sequence_results进一步细化行为

  • allow_partial_sequence_results (bool | None) – 此标志仅适用于序列,且仅在allow_partial_search_results=true时有效。如果为true,序列查询将基于可用分片返回结果,忽略其他分片。如果为false,序列查询将成功返回,但结果始终为空。

  • case_sensitive (bool | None)

  • ccs_minimize_roundtrips (bool | None) – 指示是否应最小化网络往返作为跨集群搜索请求执行的一部分

  • event_category_field (str | None) – 包含事件分类的字段,如进程、文件或网络。

  • expand_wildcards (Sequence[str | Literal['all', 'closed', 'hidden', 'none', 'open']] | str | ~typing.Literal['all', 'closed', 'hidden', 'none', 'open'] | None) – 是否将通配符表达式扩展到开放、关闭或两者兼有的具体索引。

  • fetch_size (int | None) – 序列查询一次搜索的最大事件数。

  • fields (Mapping[str, Any] | Sequence[Mapping[str, Any]] | None) – 通配符(*)模式数组。响应会在每个命中的fields属性中返回匹配这些模式的字段名值。

  • filter (Mapping[str, Any] | Sequence[Mapping[str, Any]] | None) – 用Query DSL编写的查询,用于过滤运行EQL查询的事件。

  • ignore_unavailable (bool | None) – 如果为true,响应中不包含缺失或关闭的索引。

  • keep_alive (str | Literal[-1] | ~typing.Literal[0] | None)

  • keep_on_completion (bool | None)

  • max_samples_per_key (int | None) – 默认情况下,样本查询的响应包含最多`10`个样本,每个唯一连接键集一个样本。使用`size`参数获取更小或更大的样本集。要检索每个连接键集的多个样本,使用`max_samples_per_key`参数。样本查询不支持管道。

  • result_position (str | Literal['head', 'tail'] | None)

  • runtime_mappings (Mapping[str, Mapping[str, Any]] | None)

  • size (int | None) – 对于基本查询,返回的最大匹配事件数。默认为10

  • tiebreaker_field (str | None) – 用于按升序对具有相同时间戳的命中进行排序的字段

  • timestamp_field (str | None) – 包含事件时间戳的字段。默认为”@timestamp”

  • wait_for_completion_timeout (str | Literal[-1] | ~typing.Literal[0] | None)

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]