task-management.asciidoc 852 B

1234567891011121314151617181920212223242526272829303132333435
  1. [[esql-task-management]]
  2. === {esql} task management
  3. ++++
  4. <titleabbrev>Task management</titleabbrev>
  5. ++++
  6. You can list running {esql} queries with the <<tasks,task management API>>:
  7. [source,console,id=esql-task-management-get-all]
  8. ----
  9. GET /_tasks?pretty&detailed&group_by=parents&human&actions=*data/read/esql
  10. ----
  11. Which returns a list of statuses like this:
  12. [source,js]
  13. ----
  14. include::{esql-specs}/query_task.json[]
  15. ----
  16. // NOTCONSOLE
  17. // Tested in a unit test
  18. <1> The user submitted query.
  19. <2> Time the query has been running.
  20. You can use this to find long running queries and, if you need to, cancel them
  21. with the <<task-cancellation, task cancellation API>>:
  22. [source,console,id=esql-task-management-cancelEsqlQueryRequestTests]
  23. ----
  24. POST _tasks/2j8UKw1bRO283PMwDugNNg:5326/_cancel
  25. ----
  26. It may take a few seconds for the query to be stopped.