AuthThe Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.AvailabilityExperimental since 2.3This functionality is experimental and is not ready for production usage. Experimental features may change or be removed at any time. Elastic will work to fix any issues, but experimental features are not subject to the support SLA of official GA features. Specific Support terms apply.Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Get information about the tasks currently running on one or more nodes in the cluster.
Warning
The task management API is new and should still be considered a beta feature.
The API may change in ways that are not backwards compatible.
For relocatable tasks, this API transparently follows the task across graceful shutdown relocations,
so callers can keep using the original task ID. The returned task reports its original_task_id and original_start_time_in_millis
if it is continuing work from an earlier task.
Identifying running tasks
The X-Opaque-Id header, when provided on the HTTP request header, is going to be returned as a header in the response as well as in the headers field for in the task information.
This enables you to track certain calls or associate certain tasks with the client that started them.
For example:
In this example, X-Opaque-Id: 123456 is the ID as a part of the response header.
The X-Opaque-Id in the task headers is the ID for the task that was initiated by the REST request.
The X-Opaque-Id in the children headers is the child task of the task that was initiated by the REST request.
A comma-separated list or wildcard expression of actions used to limit the request.
For example, you can use cluser:* to retrieve all cluster-related tasks.
detailedboolean · default: false
If true, the response includes detailed information about the running tasks.
This information is useful to distinguish tasks from each other but is more costly to run.
group_byenum · default: nodes
A key that is used to group tasks in the response.
The task lists can be grouped either by nodes or by parent tasks.
Supported values include:
nodes: Group tasks by node ID.
parents: Group tasks by parent task ID.
none: Do not group tasks.
Values:nodesparentsnone
nodesunionstring | string[]
A comma-separated list of node IDs or names that is used to limit the returned information.
parent_task_idstring
A parent task identifier that is used to limit returned information.
To return all tasks, omit this parameter or use a value of -1.
If the parent task is not found, the API does not return a 404 response code.
timeoutstring · default: 30s
The period to wait for each node to respond.
If a node does not respond before its timeout expires, the response does not include its information.
However, timed out nodes are included in the node_failures property.
wait_for_completionboolean · default: false
If true, the request blocks until the operation is complete.
Task information grouped by node, if group_by was set to node (the default).
<string>object
namestring
transport_addressstring
hoststring
ipstring
rolesstring[]
attributesmapstring to string
tasksmapstring to objectrequired
<string>object
actionstringrequired
cancelledboolean
cancellablebooleanrequired
descriptionstring
Human readable text that identifies the particular request that the task is performing.
For example, it might identify the search request being performed by a search task.
Other kinds of tasks have different descriptions, like _reindex which has the source and the destination, or _bulk which just has the number of requests and the destination indices.
Many requests will have only an empty description because more detailed information about the request is not easily available or particularly helpful in identifying the request.
headersmapstring to stringrequired
idnumberrequired
nodestringrequired
running_timestring
running_time_in_nanosnumberrequired
start_time_in_millisnumberrequired
statusobject
The internal status of the task, which varies from task to task.
The format also varies.
While the goal is to keep the status for a particular task consistent from version to version, this is not always possible because sometimes the implementation changes.
Fields might be removed from the status for a particular request so any parsing you do of the status might break in minor releases.
typestringrequired
parent_task_idstring
original_task_idstring
The task ID of the original task. Only present when the task is continuing the work of an earlier task that was running on a node which has since shut down (i.e. a relocatable task).
For tasks that have not been relocated this is always equal to the task's own ID and is omitted from the response.
original_start_time_in_millisnumber
The time at which the original task started, in milliseconds since the Unix epoch. Only present together with original_task_id.
original_start_timestring
The time at which the original task started, as an ISO 8601 formatted string. Only present together with original_task_id and when the request includes the ?human=true query parameter.
tasksuniononeOf
Either a flat list of tasks if group_by was set to none, or grouped by parents if
group_by was set to parents.
One of:
{}TaskInfo[]
actionstringrequired
cancelledboolean
cancellablebooleanrequired
descriptionstring
Human readable text that identifies the particular request that the task is performing.
For example, it might identify the search request being performed by a search task.
Other kinds of tasks have different descriptions, like _reindex which has the source and the destination, or _bulk which just has the number of requests and the destination indices.
Many requests will have only an empty description because more detailed information about the request is not easily available or particularly helpful in identifying the request.
headersmapstring to stringrequired
idnumberrequired
nodestringrequired
running_timestring
running_time_in_nanosnumberrequired
start_time_in_millisnumberrequired
statusobject
The internal status of the task, which varies from task to task.
The format also varies.
While the goal is to keep the status for a particular task consistent from version to version, this is not always possible because sometimes the implementation changes.
Fields might be removed from the status for a particular request so any parsing you do of the status might break in minor releases.
typestringrequired
parent_task_idstring
original_task_idstring
The task ID of the original task. Only present when the task is continuing the work of an earlier task that was running on a node which has since shut down (i.e. a relocatable task).
For tasks that have not been relocated this is always equal to the task's own ID and is omitted from the response.
original_start_time_in_millisnumber
The time at which the original task started, in milliseconds since the Unix epoch. Only present together with original_task_id.
original_start_timestring
The time at which the original task started, as an ISO 8601 formatted string. Only present together with original_task_id and when the request includes the ?human=true query parameter.
<string>object
actionstringrequired
cancelledboolean
cancellablebooleanrequired
descriptionstring
Human readable text that identifies the particular request that the task is performing.
For example, it might identify the search request being performed by a search task.
Other kinds of tasks have different descriptions, like _reindex which has the source and the destination, or _bulk which just has the number of requests and the destination indices.
Many requests will have only an empty description because more detailed information about the request is not easily available or particularly helpful in identifying the request.
headersmapstring to stringrequired
idnumberrequired
nodestringrequired
running_timestring
running_time_in_nanosnumberrequired
start_time_in_millisnumberrequired
statusobject
The internal status of the task, which varies from task to task.
The format also varies.
While the goal is to keep the status for a particular task consistent from version to version, this is not always possible because sometimes the implementation changes.
Fields might be removed from the status for a particular request so any parsing you do of the status might break in minor releases.
typestringrequired
parent_task_idstring
original_task_idstring
The task ID of the original task. Only present when the task is continuing the work of an earlier task that was running on a node which has since shut down (i.e. a relocatable task).
For tasks that have not been relocated this is always equal to the task's own ID and is omitted from the response.
original_start_time_in_millisnumber
The time at which the original task started, in milliseconds since the Unix epoch. Only present together with original_task_id.
original_start_timestring
The time at which the original task started, as an ISO 8601 formatted string. Only present together with original_task_id and when the request includes the ?human=true query parameter.
childrenobject[]
actionstringrequired
cancelledboolean
cancellablebooleanrequired
descriptionstring
Human readable text that identifies the particular request that the task is performing.
For example, it might identify the search request being performed by a search task.
Other kinds of tasks have different descriptions, like _reindex which has the source and the destination, or _bulk which just has the number of requests and the destination indices.
Many requests will have only an empty description because more detailed information about the request is not easily available or particularly helpful in identifying the request.
headersmapstring to stringrequired
idnumberrequired
nodestringrequired
running_timestring
running_time_in_nanosnumberrequired
start_time_in_millisnumberrequired
statusobject
The internal status of the task, which varies from task to task.
The format also varies.
While the goal is to keep the status for a particular task consistent from version to version, this is not always possible because sometimes the implementation changes.
Fields might be removed from the status for a particular request so any parsing you do of the status might break in minor releases.
typestringrequired
parent_task_idstring
original_task_idstring
The task ID of the original task. Only present when the task is continuing the work of an earlier task that was running on a node which has since shut down (i.e. a relocatable task).
For tasks that have not been relocated this is always equal to the task's own ID and is omitted from the response.
original_start_time_in_millisnumber
The time at which the original task started, in milliseconds since the Unix epoch. Only present together with original_task_id.
original_start_timestring
The time at which the original task started, as an ISO 8601 formatted string. Only present together with original_task_id and when the request includes the ?human=true query parameter.