Query watches
Generally available; Added in 7.11.0
Get all registered watches in a paginated manner and optionally filter watches by a query.
Note that only the _id
and metadata.*
fields are queryable or sortable.
Required authorization
- Cluster privileges:
monitor_watcher
Body
-
from
number The offset from the first result to fetch. It must be non-negative.
-
size
number The number of hits to return. It must be non-negative.
-
query
object An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.
External documentation -
search_after
array[number | string | boolean | null] A field value.
POST
/_watcher/_query/watches
Console
GET /_watcher/_query/watches
resp = client.watcher.query_watches()
const response = await client.watcher.queryWatches();
response = client.watcher.query_watches
$resp = $client->watcher()->queryWatches();
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/_query/watches"
Response examples (200)
A successful response from `GET /_watcher/_query/watches`.
{
"count": 1,
"watches": [
{
"_id": "my_watch",
"watch": {
"trigger": {
"schedule": {
"hourly": {
"minute": [
0,
5
]
}
}
},
"input": {
"simple": {
"payload": {
"send": "yes"
}
}
},
"condition": {
"always": {}
},
"actions": {
"test_index": {
"index": {
"index": "test"
}
}
}
},
"status": {
"state": {
"active": true,
"timestamp": "2015-05-26T18:21:08.630Z"
},
"actions": {
"test_index": {
"ack": {
"timestamp": "2015-05-26T18:21:08.630Z",
"state": "awaits_successful_execution"
}
}
},
"version": -1
},
"_seq_no": 0,
"_primary_term": 1
}
]
}