Get a watch Generally available; Added in 5.6.0

GET /_watcher/watch/{id}

Required authorization

  • Cluster privileges: monitor_watcher

Path parameters

  • id string Required

    The watch identifier.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • found boolean Required
    • _id string Required
    • status object
      Hide status attributes Show status attributes object
      • actions object Required
        Hide actions attribute Show actions attribute object
        • * object Additional properties
      • last_checked string | number

        One of:

        Time unit for milliseconds

      • last_met_condition string | number

        One of:

        Time unit for milliseconds

      • state object Required
        Hide state attributes Show state attributes object
        • active boolean Required
        • timestamp
      • version number Required
      • execution_state string
    • watch object
      Hide watch attributes Show watch attributes object
      • actions object Required
        Hide actions attribute Show actions attribute object
        • * object Additional properties
          Hide * attributes Show * attributes object
          • action_type string

            Values are email, webhook, index, logging, slack, or pagerduty.

          • condition object
          • foreach string
          • max_iterations number
          • name string
          • throttle_period string

            A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

          • transform object
          • index object
          • logging object
          • slack object
      • condition object Required
        Hide condition attributes Show condition attributes object
        • always object
        • array_compare object
          Hide array_compare attribute Show array_compare attribute object
          • * object Additional properties
        • compare object
          Hide compare attribute Show compare attribute object
          • * object Additional properties
        • never object
        • script object
      • input object Required
        Hide input attributes Show input attributes object
        • chain object
        • http object
        • simple object
          Hide simple attribute Show simple attribute object
          • * object Additional properties
      • metadata object
        Hide metadata attribute Show metadata attribute object
        • * object Additional properties
      • status object
        Hide status attributes Show status attributes object
        • actions object Required
        • last_checked
        • last_met_condition
        • state object Required
        • version number Required
        • execution_state string
      • throttle_period string

        A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

        External documentation
      • Time unit for milliseconds

      • transform object
        Hide transform attributes Show transform attributes object
        • chain array[object]
        • script object
      • trigger object Required
        Hide trigger attribute Show trigger attribute object
        • schedule object
    • _primary_term number
    • _seq_no number
    • _version number
GET /_watcher/watch/{id}
GET _watcher/watch/my_watch 
resp = client.watcher.get_watch( id="my_watch", )
const response = await client.watcher.getWatch({ id: "my_watch", });
response = client.watcher.get_watch( id: "my_watch" )
$resp = $client->watcher()->getWatch([ "id" => "my_watch", ]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_watcher/watch/my_watch"
Response examples (200)
A successful response from `GET _watcher/watch/my_watch`.
{ "found": true, "_id": "my_watch", "_seq_no": 0, "_primary_term": 1, "_version": 1, "status": { "version": 1, "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" } } } }, "watch": { "input": { "simple": { "payload": { "send": "yes" } } }, "condition": { "always": {} }, "trigger": { "schedule": { "hourly": { "minute": [0, 5] } } }, "actions": { "test_index": { "index": { "index": "test" } } } } }