mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
35 lines
852 B
Text
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.
|