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

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