eql-search-api.asciidoc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[eql-search-api]]
  4. === EQL search API
  5. ++++
  6. <titleabbrev>EQL search</titleabbrev>
  7. ++++
  8. experimental::[]
  9. Returns search results for an <<eql,Event Query Language (EQL)>> query.
  10. In {es}, EQL assumes each document in a data stream or index corresponds to an
  11. event.
  12. ////
  13. [source,console]
  14. ----
  15. PUT /my-index-000001/_bulk?refresh
  16. {"index":{ }}
  17. { "@timestamp": "2020-12-06T11:04:05.000Z", "agent": { "id": "8a4f500d" }, "event": { "category": "process", "id": "edwCRnyD", "sequence": 1 }, "process": { "name": "cmd.exe", "executable": "C:\\Windows\\System32\\cmd.exe" } }
  18. {"index":{ }}
  19. { "@timestamp": "2020-12-06T11:04:07.000Z", "agent": { "id": "8a4f500d" }, "event": { "category": "file", "id": "dGCHwoeS", "sequence": 2 }, "file": { "accessed": "2020-12-07T11:07:08.000Z", "name": "cmd.exe", "path": "C:\\Windows\\System32\\cmd.exe", "type": "file", "size": 16384 }, "process": { "name": "cmd.exe", "executable": "C:\\Windows\\System32\\cmd.exe" } }
  20. {"index":{ }}
  21. { "@timestamp": "2020-12-07T11:06:07.000Z", "agent": { "id": "8a4f500d" }, "event": { "category": "process", "id": "cMyt5SZ2", "sequence": 3 }, "process": { "name": "cmd.exe", "executable": "C:\\Windows\\System32\\cmd.exe" } }
  22. {"index":{ }}
  23. { "@timestamp": "2020-12-07T11:07:08.000Z", "agent": { "id": "8a4f500d" }, "event": { "category": "file", "id": "bYA7gPay", "sequence": 4 }, "file": { "accessed": "2020-12-07T11:07:08.000Z", "name": "cmd.exe", "path": "C:\\Windows\\System32\\cmd.exe", "type": "file", "size": 16384 }, "process": { "name": "cmd.exe", "executable": "C:\\Windows\\System32\\cmd.exe" } }
  24. {"index":{ }}
  25. { "@timestamp": "2020-12-07T11:07:09.000Z", "agent": { "id": "8a4f500d" }, "event": { "category": "process", "id": "aR3NWVOs", "sequence": 5 }, "process": { "name": "regsvr32.exe", "executable": "C:\\Windows\\System32\\regsvr32.exe" } }
  26. {"index":{ }}
  27. { "@timestamp": "2020-12-07T11:07:10.000Z", "agent": { "id": "8a4f500d" }, "event": { "category": "process", "id": "GTSmSqgz0U", "sequence": 6, "type": "termination" }, "process": { "name": "regsvr32.exe", "executable": "C:\\Windows\\System32\\regsvr32.exe" } }
  28. ----
  29. // TESTSETUP
  30. ////
  31. [source,console]
  32. ----
  33. GET /my-index-000001/_eql/search
  34. {
  35. "query": """
  36. process where process.name = "regsvr32.exe"
  37. """
  38. }
  39. ----
  40. [[eql-search-api-request]]
  41. ==== {api-request-title}
  42. `GET /<target>/_eql/search`
  43. `POST /<target>/_eql/search`
  44. [[eql-search-api-prereqs]]
  45. ==== {api-prereq-title}
  46. See <<eql-requirements,EQL requirements>>.
  47. [[eql-search-api-limitations]]
  48. ===== Limitations
  49. See <<eql-limitations,EQL limitations>>.
  50. [[eql-search-api-path-params]]
  51. ==== {api-path-parms-title}
  52. `<target>`::
  53. (Required, string)
  54. Comma-separated list of data streams, indices, or <<indices-aliases,index
  55. aliases>> used to limit the request. Accepts wildcard (`*`) expressions.
  56. +
  57. To search all data streams and indices in a cluster, use
  58. `_all` or `*`.
  59. [[eql-search-api-query-params]]
  60. ==== {api-query-parms-title}
  61. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
  62. +
  63. Defaults to `false`.
  64. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
  65. +
  66. Defaults to `open`.
  67. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
  68. `keep_alive`::
  69. +
  70. --
  71. (Optional, <<time-units,time value>>)
  72. Period for which the search and its results are stored on the cluster. Defaults
  73. to `5d` (five days).
  74. When this period expires, the search and its results are deleted, even if the
  75. search is still ongoing.
  76. If the <<eql-search-api-keep-on-completion,`keep_on_completion`>> parameter is
  77. `false`, {es} only stores <<eql-search-async,async searches>> that do not
  78. complete within the period set by the
  79. <<eql-search-api-wait-for-completion-timeout,`wait_for_completion_timeout`>>
  80. parameter, regardless of this value.
  81. [IMPORTANT]
  82. ====
  83. You can also specify this value using the `keep_alive` request body parameter.
  84. If both parameters are specified, only the query parameter is used.
  85. ====
  86. --
  87. `keep_on_completion`::
  88. +
  89. --
  90. (Optional, boolean)
  91. If `true`, the search and its results are stored on the cluster.
  92. If `false`, the search and its results are stored on the cluster only if the
  93. request does not complete during the period set by the
  94. <<eql-search-api-wait-for-completion-timeout,`wait_for_completion_timeout`>>
  95. parameter. Defaults to `false`.
  96. [IMPORTANT]
  97. ====
  98. You can also specify this value using the `keep_on_completion` request body
  99. parameter. If both parameters are specified, only the query parameter is used.
  100. ====
  101. --
  102. `wait_for_completion_timeout`::
  103. +
  104. --
  105. (Optional, <<time-units,time value>>)
  106. Timeout duration to wait for the request to finish. Defaults to no
  107. timeout, meaning the request waits for complete search results.
  108. If this parameter is specified and the request completes during this period,
  109. complete search results are returned.
  110. If the request does not complete during this period, the search becomes an
  111. <<eql-search-async,async search>>.
  112. [IMPORTANT]
  113. ====
  114. You can also specify this value using the `wait_for_completion_timeout` request
  115. body parameter. If both parameters are specified, only the query parameter is
  116. used.
  117. ====
  118. --
  119. [[eql-search-api-request-body]]
  120. ==== {api-request-body-title}
  121. `case_sensitive`::
  122. (Optional, boolean)
  123. If `true`, matching for the <<eql-search-api-request-query-param,EQL query>> is
  124. case sensitive. Defaults to `false`.
  125. `event_category_field`::
  126. (Required*, string)
  127. Field containing the event classification, such as `process`, `file`, or
  128. `network`.
  129. +
  130. Defaults to `event.category`, as defined in the {ecs-ref}/ecs-event.html[Elastic
  131. Common Schema (ECS)]. If a data stream or index does not contain the
  132. `event.category` field, this value is required.
  133. `fetch_size`::
  134. (Optional, integer)
  135. Maximum number of events to search at a time for sequence queries. Defaults to
  136. `1000`.
  137. +
  138. This value must be greater than `2` but cannot exceed the value of the
  139. <<index-max-result-window,`index.max_result_window`>> setting, which defaults to
  140. `10000`.
  141. +
  142. Internally, a sequence query fetches and paginates sets of events to search for
  143. matches. This parameter controls the size of those sets. This parameter does not
  144. limit the total number of events searched or the number of matching events
  145. returned.
  146. +
  147. A greater `fetch_size` value often increases search speed but uses more memory.
  148. `filter`::
  149. (Optional, <<query-dsl,query DSL object>>)
  150. Query, written in query DSL, used to filter the events on which the EQL query
  151. runs.
  152. `keep_alive`::
  153. +
  154. --
  155. (Optional, <<time-units,time value>>)
  156. Period for which the search and its results are stored on the cluster. Defaults
  157. to `5d` (five days).
  158. When this period expires, the search and its results are deleted, even if the
  159. search is still ongoing.
  160. If the <<eql-search-api-keep-on-completion,`keep_on_completion`>> parameter is
  161. `false`, {es} only stores <<eql-search-async,async searches>> that do not
  162. complete within the period set by the
  163. <<eql-search-api-wait-for-completion-timeout,`wait_for_completion_timeout`>>
  164. parameter, regardless of this value.
  165. [IMPORTANT]
  166. ====
  167. You can also specify this value using the `keep_alive` query parameter.
  168. If both parameters are specified, only the query parameter is used.
  169. ====
  170. --
  171. [[eql-search-api-keep-on-completion]]
  172. `keep_on_completion`::
  173. +
  174. --
  175. (Optional, boolean)
  176. If `true`, the search and its results are stored on the cluster.
  177. If `false`, the search and its results are stored on the cluster only if the
  178. request does not complete during the period set by the
  179. <<eql-search-api-wait-for-completion-timeout,`wait_for_completion_timeout`>>
  180. parameter. Defaults to `false`.
  181. [IMPORTANT]
  182. ====
  183. You can also specify this value using the `keep_on_completion` query parameter.
  184. If both parameters are specified, only the query parameter is used.
  185. ====
  186. --
  187. [[eql-search-api-request-query-param]]
  188. `query`::
  189. (Required, string)
  190. <<eql-syntax,EQL>> query you wish to run.
  191. +
  192. IMPORTANT: This parameter supports a subset of EQL syntax. See
  193. <<eql-unsupported-syntax>>.
  194. `size`::
  195. (Optional, integer or float)
  196. For <<eql-basic-syntax,basic queries>>, the maximum number of matching events to
  197. return.
  198. +
  199. For <<eql-sequences,sequence queries>>, the maximum number of matching sequences
  200. to return.
  201. +
  202. Defaults to `10`. This value must be greater than `0`.
  203. +
  204. NOTE: You cannot use <<eql-pipe-ref,pipes>>, such as `head` or `tail`, to exceed
  205. this value.
  206. [[eql-search-api-tiebreaker-field]]
  207. `tiebreaker_field`::
  208. (Optional, string)
  209. Field used to sort events with the same
  210. <<eql-search-api-timestamp-field,timestamp field>> value. Defaults to
  211. `event.sequence`, as defined in the {ecs-ref}/ecs-event.html[Elastic Common
  212. Schema (ECS)].
  213. +
  214. By default, matching events in the search response are sorted by timestamp,
  215. converted to milliseconds since the https://en.wikipedia.org/wiki/Unix_time[Unix
  216. epoch], in ascending order. If two or more events share the same timestamp, this
  217. field is used to sort the events in ascending, lexicographic order.
  218. [[eql-search-api-timestamp-field]]
  219. `timestamp_field`::
  220. +
  221. --
  222. (Required*, string)
  223. Field containing event timestamp.
  224. Defaults to `@timestamp`, as defined in the
  225. {ecs-ref}/ecs-event.html[Elastic Common Schema (ECS)]. If a data stream or index
  226. does not contain the `@timestamp` field, this value is required.
  227. Events in the API response are sorted by this field's value, converted to
  228. milliseconds since the https://en.wikipedia.org/wiki/Unix_time[Unix epoch], in
  229. ascending order.
  230. --
  231. [[eql-search-api-wait-for-completion-timeout]]
  232. `wait_for_completion_timeout`::
  233. +
  234. --
  235. (Optional, <<time-units,time value>>)
  236. Timeout duration to wait for the request to finish. Defaults to no
  237. timeout, meaning the request waits for complete search results.
  238. If this parameter is specified and the request completes during this period,
  239. complete search results are returned.
  240. If the request does not complete during this period, the search becomes an
  241. <<eql-search-async,async search>>.
  242. [IMPORTANT]
  243. ====
  244. You can also specify this value using the `wait_for_completion_timeout` query
  245. parameter. If both parameters are specified, only the query parameter is used.
  246. ====
  247. --
  248. [role="child_attributes"]
  249. [[eql-search-api-response-body]]
  250. ==== {api-response-body-title}
  251. [[eql-search-api-response-body-search-id]]
  252. `id`::
  253. +
  254. --
  255. (string)
  256. Identifier for the search.
  257. This search ID is only provided if one of the following conditions is met:
  258. * A search request does not return complete results during the
  259. <<eql-search-api-wait-for-completion-timeout,`wait_for_completion_timeout`>>
  260. parameter's timeout period, becoming an <<eql-search-async,async search>>.
  261. * The search request's <<eql-search-api-keep-on-completion,`keep_on_completion`>>
  262. parameter is `true`.
  263. You can use this ID with the <<get-async-eql-search-api,get async EQL search
  264. API>> to get the current status and available results for the search.
  265. --
  266. `is_partial`::
  267. (boolean)
  268. If `true`, the response does not contain complete search results.
  269. `is_running`::
  270. +
  271. --
  272. (boolean)
  273. If `true`, the search request is still executing.
  274. [IMPORTANT]
  275. ====
  276. If this parameter and the `is_partial` parameter are `true`, the search is an
  277. <<eql-search-async,ongoing async search>>. If the `keep_alive` period does not
  278. pass, the complete search results will be available when the search completes.
  279. If `is_partial` is `true` but `is_running` is `false`, the search returned
  280. partial results due to a failure. Only some shards returned results or the node
  281. coordinating the search failed.
  282. ====
  283. --
  284. `took`::
  285. +
  286. --
  287. (integer)
  288. Milliseconds it took {es} to execute the request.
  289. This value is calculated by measuring the time elapsed
  290. between receipt of a request on the coordinating node
  291. and the time at which the coordinating node is ready to send the response.
  292. Took time includes:
  293. * Communication time between the coordinating node and data nodes
  294. * Time the request spends in the `search` <<modules-threadpool,thread pool>>,
  295. queued for execution
  296. * Actual execution time
  297. Took time does *not* include:
  298. * Time needed to send the request to {es}
  299. * Time needed to serialize the JSON response
  300. * Time needed to send the response to a client
  301. --
  302. `timed_out`::
  303. (boolean)
  304. If `true`, the request timed out before completion.
  305. `hits`::
  306. (object)
  307. Contains matching events and sequences. Also contains related metadata.
  308. +
  309. .Properties of `hits`
  310. [%collapsible%open]
  311. ====
  312. `total`::
  313. (object)
  314. Metadata about the number of matching events or sequences.
  315. +
  316. .Properties of `total`
  317. [%collapsible%open]
  318. =====
  319. `value`::
  320. (integer)
  321. For <<eql-basic-syntax,basic queries>>, the total number of matching events.
  322. +
  323. For <<eql-sequences,sequence queries>>, the total number of matching sequences.
  324. `relation`::
  325. +
  326. --
  327. (string)
  328. Indicates whether the number of events or sequences returned is accurate or a
  329. lower bound.
  330. Returned values are:
  331. `eq`::: Accurate
  332. `gte`::: Lower bound, including returned events or sequences
  333. --
  334. =====
  335. `sequences`::
  336. (array of objects)
  337. Contains event sequences matching the query. Each object represents a
  338. matching sequence. This parameter is only returned for EQL queries containing
  339. a <<eql-sequences,sequence>>.
  340. +
  341. .Properties of `sequences` objects
  342. [%collapsible%open]
  343. =====
  344. `join_keys`::
  345. (array of strings)
  346. Shared field values used to constrain matches in the sequence. These are defined
  347. using the <<eql-sequences,`by` keyword>> in the EQL query syntax.
  348. `events`::
  349. (array of objects)
  350. Contains events matching the query. Each object represents a
  351. matching event.
  352. +
  353. .Properties of `events` objects
  354. [%collapsible%open]
  355. ======
  356. `_index`::
  357. (string)
  358. Name of the index containing the event.
  359. `_id`::
  360. (string)
  361. Unique identifier for the event.
  362. This ID is only unique within the index.
  363. `_version`::
  364. (integer)
  365. Version of the document (event). This version is incremented each time the document is
  366. updated.
  367. `_seq_no`::
  368. (integer)
  369. Sequence number assigned to the document (event).
  370. +
  371. Sequence numbers are used to ensure an older version of a document
  372. doesn’t overwrite a newer version. See <<optimistic-concurrency-control>>.
  373. `_primary_term`::
  374. (integer)
  375. Primary term assigned to the document. See <<optimistic-concurrency-control>>.
  376. `_score`::
  377. (float)
  378. Positive 32-bit floating point number used to determine the relevance of the
  379. event. See <<relevance-scores>>.
  380. `_source`::
  381. (object)
  382. Original JSON body passed for the event at index time.
  383. ======
  384. =====
  385. [[eql-search-api-response-events]]
  386. `events`::
  387. (array of objects)
  388. Contains events matching the query. Each object represents a
  389. matching event.
  390. +
  391. .Properties of `events` objects
  392. [%collapsible%open]
  393. =====
  394. `_index`::
  395. (string)
  396. Name of the index containing the event.
  397. `_id`::
  398. (string)
  399. (string)
  400. Unique identifier for the event.
  401. This ID is only unique within the index.
  402. `_score`::
  403. (float)
  404. Positive 32-bit floating point number used to determine the relevance of the
  405. event. See <<relevance-scores>>.
  406. `_source`::
  407. (object)
  408. Original JSON body passed for the event at index time.
  409. =====
  410. ====
  411. [[eql-search-api-example]]
  412. ==== {api-examples-title}
  413. [[eql-search-api-basic-query-ex]]
  414. ===== Basic query example
  415. The following EQL search request searches for events with an `event.category` of
  416. `file` that meet the following conditions:
  417. * A `file.name` of `cmd.exe`
  418. * An `agent.id` other than `8a4f526c`
  419. [source,console]
  420. ----
  421. GET /my-index-000001/_eql/search
  422. {
  423. "query": """
  424. file where (file.name == "cmd.exe" and agent.id != "8a4f526c")
  425. """
  426. }
  427. ----
  428. // TEST[s/search/search\?filter_path\=\-\*\.events\.\*fields/]
  429. The API returns the following response. Matching events in the `hits.events`
  430. property are sorted by <<eql-search-api-timestamp-field,timestamp>>, converted
  431. to milliseconds since the https://en.wikipedia.org/wiki/Unix_time[Unix epoch],
  432. in ascending order.
  433. If two or more events share the same timestamp, the
  434. <<eql-search-api-tiebreaker-field,`tiebreaker_field`>> field is used to sort
  435. the events in ascending, lexicographic order.
  436. [source,console-result]
  437. ----
  438. {
  439. "is_partial": false,
  440. "is_running": false,
  441. "took": 6,
  442. "timed_out": false,
  443. "hits": {
  444. "total": {
  445. "value": 2,
  446. "relation": "eq"
  447. },
  448. "events": [
  449. {
  450. "_index": "my-index-000001",
  451. "_id": "fwGeywNsBl8Y9Ys1x51b",
  452. "_score": null,
  453. "_source": {
  454. "@timestamp": "2020-12-06T11:04:07.000Z",
  455. "agent": {
  456. "id": "8a4f500d"
  457. },
  458. "event": {
  459. "category": "file",
  460. "id": "dGCHwoeS",
  461. "sequence": 2,
  462. },
  463. "file": {
  464. "accessed": "2020-12-07T11:07:08.000Z",
  465. "name": "cmd.exe",
  466. "path": "C:\\Windows\\System32\\cmd.exe",
  467. "type": "file",
  468. "size": 16384
  469. },
  470. "process": {
  471. "name": "cmd.exe",
  472. "executable": "C:\\Windows\\System32\\cmd.exe"
  473. }
  474. }
  475. },
  476. {
  477. "_index": "my-index-000001",
  478. "_id": "AtOJ4UjUBAAx3XR5kcCM",
  479. "_score": null,
  480. "_source": {
  481. "@timestamp": "2020-12-07T11:07:08.000Z",
  482. "agent": {
  483. "id": "8a4f500d"
  484. },
  485. "event": {
  486. "category": "file",
  487. "id": "bYA7gPay",
  488. "sequence": 4
  489. },
  490. "file": {
  491. "accessed": "2020-12-07T11:07:08.000Z",
  492. "name": "cmd.exe",
  493. "path": "C:\\Windows\\System32\\cmd.exe",
  494. "type": "file",
  495. "size": 16384
  496. },
  497. "process": {
  498. "name": "cmd.exe",
  499. "executable": "C:\\Windows\\System32\\cmd.exe"
  500. }
  501. }
  502. }
  503. ]
  504. }
  505. }
  506. ----
  507. // TESTRESPONSE[s/"took": 6/"took": $body.took/]
  508. // TESTRESPONSE[s/"_id": "fwGeywNsBl8Y9Ys1x51b"/"_id": $body.hits.events.0._id/]
  509. // TESTRESPONSE[s/"_id": "AtOJ4UjUBAAx3XR5kcCM"/"_id": $body.hits.events.1._id/]
  510. [[eql-search-api-sequence-ex]]
  511. ===== Sequence query example
  512. The following EQL search request matches a <<eql-sequences,sequence>> of events
  513. that:
  514. . Start with an event with:
  515. +
  516. --
  517. * An `event.category` of `file`
  518. * A `file.name` of `cmd.exe`
  519. * An `agent.id` other than `8a4f526c`
  520. --
  521. . Followed by an event with:
  522. +
  523. --
  524. * An `event.category` of `process`
  525. * A `process.executable` that contains the substring `regsvr32`
  526. --
  527. These events must also share the same `agent.id` value.
  528. [source,console]
  529. ----
  530. GET /my-index-000001/_eql/search
  531. {
  532. "query": """
  533. sequence by agent.id
  534. [ file where file.name == "cmd.exe" and agent.id != "8a4f526c" ]
  535. [ process where stringContains(process.executable, "regsvr32") ]
  536. """
  537. }
  538. ----
  539. The API returns the following response. The `hits.sequences.join_keys` property
  540. contains the shared `agent.id` value for each matching event. Matching events in
  541. the `hits.sequences.events` property are sorted by
  542. <<eql-search-api-timestamp-field,timestamp>>, converted to milliseconds since
  543. the https://en.wikipedia.org/wiki/Unix_time[Unix epoch], in ascending order.
  544. If two or more events share the same timestamp, the
  545. <<eql-search-api-tiebreaker-field,`tiebreaker_field`>> field is used to sort
  546. the events in ascending, lexicographic order.
  547. [source,console-result]
  548. ----
  549. {
  550. "is_partial": false,
  551. "is_running": false,
  552. "took": 6,
  553. "timed_out": false,
  554. "hits": {
  555. "total": {
  556. "value": 1,
  557. "relation": "eq"
  558. },
  559. "sequences": [
  560. {
  561. "join_keys": [
  562. "8a4f500d"
  563. ],
  564. "events": [
  565. {
  566. "_index": "my-index-000001",
  567. "_id": "AtOJ4UjUBAAx3XR5kcCM",
  568. "_version": 1,
  569. "_seq_no": 3,
  570. "_primary_term": 1,
  571. "_score": null,
  572. "_source": {
  573. "@timestamp": "2020-12-07T11:07:08.000Z",
  574. "agent": {
  575. "id": "8a4f500d"
  576. },
  577. "event": {
  578. "category": "file",
  579. "id": "bYA7gPay",
  580. "sequence": 4
  581. },
  582. "file": {
  583. "accessed": "2020-12-07T11:07:08.000Z",
  584. "name": "cmd.exe",
  585. "path": "C:\\Windows\\System32\\cmd.exe",
  586. "type": "file",
  587. "size": 16384
  588. },
  589. "process": {
  590. "name": "cmd.exe",
  591. "executable": "C:\\Windows\\System32\\cmd.exe"
  592. }
  593. }
  594. },
  595. {
  596. "_index": "my-index-000001",
  597. "_id": "yDwnGIJouOYGBzP0ZE9n",
  598. "_version": 1,
  599. "_seq_no": 4,
  600. "_primary_term": 1,
  601. "_score": null,
  602. "_source": {
  603. "@timestamp": "2020-12-07T11:07:09.000Z",
  604. "agent": {
  605. "id": "8a4f500d"
  606. },
  607. "event": {
  608. "category": "process",
  609. "id": "aR3NWVOs",
  610. "sequence": 5
  611. },
  612. "process": {
  613. "name": "regsvr32.exe",
  614. "executable": "C:\\Windows\\System32\\regsvr32.exe"
  615. }
  616. }
  617. }
  618. ]
  619. }
  620. ]
  621. }
  622. }
  623. ----
  624. // TESTRESPONSE[s/"took": 6/"took": $body.took/]
  625. // TESTRESPONSE[s/"_id": "AtOJ4UjUBAAx3XR5kcCM"/"_id": $body.hits.sequences.0.events.0._id/]
  626. // TESTRESPONSE[s/"_id": "yDwnGIJouOYGBzP0ZE9n"/"_id": $body.hits.sequences.0.events.1._id/]