Query watches Generally available; Added in 7.11.0
All methods and paths for this operation:
GET /_watcher/_query/watches
POST /_watcher/_query/watches
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
-
The offset from the first result to fetch. It must be non-negative.
Default value is
0
. -
The number of hits to return. It must be non-negative.
Default value is
10
. -
An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.
External documentation -
A field value.
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"
client.watcher().queryWatches();
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 } ] }