get-async-eql-status-api.asciidoc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. [role="xpack"]
  2. [[get-async-eql-status-api]]
  3. === Get async EQL status API
  4. ++++
  5. <titleabbrev>Get async EQL search status</titleabbrev>
  6. ++++
  7. Returns the current status for an <<eql-search-async,async EQL search>> or
  8. a <<eql-search-store-sync-eql-search,stored synchronous EQL search>>
  9. without returning results. This is a more lightweight API than
  10. <<get-async-eql-search-api,get async EQL search API>> as it doesn't return
  11. search results, and reports only the status.
  12. If the {es} {security-features} are enabled, the access to the get async
  13. eql status API is restricted to the <<built-in-roles, monitoring_user role>>.
  14. [source,console]
  15. ----
  16. GET /_eql/search/status/FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=
  17. ----
  18. // TEST[skip: no access to search ID]
  19. [[get-async-eql-status-api-request]]
  20. ==== {api-request-title}
  21. `GET /_eql/search/status/<search_id>`
  22. [[get-async-eql-status-api-path-params]]
  23. ==== {api-path-parms-title}
  24. `<search_id>`::
  25. (Required, string)
  26. Identifier for the search.
  27. +
  28. A search ID is provided in the <<eql-search-api,EQL search API>>'s response for
  29. an <<eql-search-async,async search>>. A search ID is also provided if the
  30. request's <<eql-search-api-keep-on-completion,`keep_on_completion`>> parameter
  31. is `true`.
  32. [role="child_attributes"]
  33. [[get-async-eql-status-api-response-body]]
  34. ==== {api-response-body-title}
  35. `id`::
  36. (string)
  37. Identifier for the search.
  38. `is_running`::
  39. (boolean)
  40. If `true`, the search request is still executing.
  41. If `false`, the search is completed.
  42. `is_partial`::
  43. (boolean)
  44. If `true`, the response does not contain complete search results.
  45. This could be because either the search is still running
  46. (`is_running` status is `false`), or because it is already completed
  47. (`is_running` status is `true`) and results are partial due to
  48. failures or timeouts.
  49. `start_time_in_millis`::
  50. (Long)
  51. For a running search shows a timestamp when the eql search
  52. started, in milliseconds since the Unix epoch.
  53. `expiration_time_in_millis`::
  54. (long)
  55. Shows a timestamp when the eql search will be expired, in milliseconds
  56. since the Unix epoch. When this time is reached, the search and its results
  57. are deleted, even if the search is still ongoing.
  58. `completion_status`::
  59. (Integer)
  60. For a completed search shows the http status code of the completed
  61. search.
  62. [[eql-status-api-example]]
  63. ==== {api-examples-title}
  64. [source,console]
  65. ----
  66. GET /_eql/search/status/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=?keep_alive=5d
  67. ----
  68. // TEST[skip: no access to search ID]
  69. If the search is still running, the status response has the following form:
  70. [source,console-result]
  71. --------------------------------------------------
  72. {
  73. "id" : "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
  74. "is_running" : true,
  75. "is_partial" : true,
  76. "start_time_in_millis" : 1611690235000,
  77. "expiration_time_in_millis" : 1611690295000
  78. }
  79. --------------------------------------------------
  80. // TEST[skip: no access to search ID]
  81. If the search is completed the status response doesn't have
  82. `start_time_in_millis`, but has an additional `completion_status`
  83. field that shows the status code of the completed eql search:
  84. [source,console-result]
  85. --------------------------------------------------
  86. {
  87. "id" : "FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=",
  88. "is_running" : false,
  89. "is_partial" : false,
  90. "expiration_time_in_millis" : 1611690295000,
  91. "completion_status" : 200 <1>
  92. }
  93. --------------------------------------------------
  94. // TEST[skip: no access to search ID]
  95. <1> Indicates that the eql search was successfully completed