elasticsearch/docs/reference/esql/task-management.asciidoc
Abdon Pijpelink 8e96d285c0
[DOCS] One more round of restructuring the ES|QL documentation (#101340)
* Reorg some pages

* Add links to landing page
2023-10-26 10:57:05 +02:00

35 lines
852 B
Text

[[esql-task-management]]
=== {esql} task management
++++
<titleabbrev>Task management</titleabbrev>
++++
You can list running {esql} queries with the <<tasks,task management API>>:
[source,console,id=esql-task-management-get-all]
----
GET /_tasks?pretty&detailed&group_by=parents&human&actions=*data/read/esql
----
Which returns a list of statuses like this:
[source,js]
----
include::{esql-specs}/query_task.json[]
----
// NOTCONSOLE
// Tested in a unit test
<1> The user submitted query.
<2> Time the query has been running.
You can use this to find long running queries and, if you need to, cancel them
with the <<task-cancellation, task cancellation API>>:
[source,console,id=esql-task-management-cancelEsqlQueryRequestTests]
----
POST _tasks/2j8UKw1bRO283PMwDugNNg:5326/_cancel
----
It may take a few seconds for the query to be stopped.