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
          Hide * attributes Show * attributes object
          • ack object Required
            Hide ack attributes Show ack attributes object
            • state string Required

              Values are awaits_successful_execution, ackable, or acked.

            • timestamp string
          • last_execution object
            Hide last_execution attributes Show last_execution attributes object
            • successful boolean Required
            • timestamp string
            • reason string
          • last_successful_execution object
            Hide last_successful_execution attributes Show last_successful_execution attributes object
            • successful boolean Required
            • timestamp string
            • reason string
          • last_throttle object
            Hide last_throttle attributes Show last_throttle attributes object
            • reason string Required
            • timestamp string
      • last_checked string | number

        A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

        One of:

        Time unit for milliseconds

      • last_met_condition string | number

        A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

        One of:

        Time unit for milliseconds

      • state object Required
        Hide state attributes Show state attributes object
        • active boolean Required
        • timestamp string | number Required

          A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

          One of:

          Time unit for milliseconds

      • 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
            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
              Hide script attributes Show script attributes object
              • lang
              • params object
              • source
              • id string
          • 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.

          • throttle_period_in_millis number

            Time unit for milliseconds

          • transform object
            Hide transform attributes Show transform attributes object
            • chain array[object]
            • script object
              Hide script attributes Show script attributes object
              • lang string
              • params object
              • source
              • id string
          • index object
            Hide index attributes Show index attributes object
            • index string Required
            • doc_id string
            • refresh string

              Values are true, false, or wait_for.

            • op_type string

              Values are index or create.

            • timeout 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.

            • execution_time_field string

              Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

          • logging object
            Hide logging attributes Show logging attributes object
            • level string
            • text string Required
            • category string
          • email object
            Hide email attributes Show email attributes object
            • id string
            • bcc
            • body object
            • cc
            • from string
            • priority string

              Values are lowest, low, normal, high, or highest.

            • reply_to
            • sent_date
            • subject string Required
            • to
            • attachments object
          • pagerduty object
            Hide pagerduty attributes Show pagerduty attributes object
            • account string
            • attach_payload boolean Required
            • client string
            • client_url string
            • contexts array[object]
            • description string Required
            • event_type string

              Values are trigger, resolve, or acknowledge.

            • incident_key string Required
            • proxy object
          • slack object
            Hide slack attributes Show slack attributes object
            • account string
            • message object Required
              Hide message attributes Show message attributes object
              • attachments array[object] Required
              • dynamic_attachments object
              • from string Required
              • icon string
              • text string Required
              • to array[string] Required
          • webhook object
            Hide webhook attributes Show webhook attributes object
            • auth object
            • body string
            • connection_timeout 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.

            • headers object
            • host string
            • method string

              Values are head, get, post, put, or delete.

            • params object
            • path string
            • port number
            • proxy object
            • read_timeout 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.

            • scheme string

              Values are http or https.

            • url string
      • 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
            Hide * attribute Show * attribute object
            • path string Required
        • compare object
          Hide compare attribute Show compare attribute object
          • * object Additional properties
        • never object
        • script object
          Hide script attributes Show script attributes object
          • lang string

            Any of:

            Values are painless, expression, mustache, or java.

          • params object
            Hide params attribute Show params attribute object
            • * object Additional properties
          • source string | object

            One of:
          • id string
      • input object Required
        Hide input attributes Show input attributes object
        • chain object
          Hide chain attribute Show chain attribute object
          • inputs array[object] Required
            Hide inputs attribute Show inputs attribute object
            • * object
        • http object
          Hide http attributes Show http attributes object
          • extract array[string]
          • request object
            Hide request attributes Show request attributes object
            • auth object
              Hide auth attribute Show auth attribute object
              • basic object Required
            • body string
            • connection_timeout 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.

            • headers object
              Hide headers attribute Show headers attribute object
              • * string Additional properties
            • host string
            • method string

              Values are head, get, post, put, or delete.

            • params object
              Hide params attribute Show params attribute object
              • * string Additional properties
            • path string
            • port number
            • proxy object
              Hide proxy attributes Show proxy attributes object
              • host string Required
              • port number Required
            • read_timeout 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.

            • scheme string

              Values are http or https.

            • url string
          • response_content_type string

            Values are json, yaml, or text.

        • 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
          Hide actions attribute Show actions attribute object
          • * object Additional properties
            Hide * attributes Show * attributes object
            • ack object Required
              Hide ack attributes Show ack attributes object
              • state string Required

                Values are awaits_successful_execution, ackable, or acked.

              • timestamp
            • last_execution object
              Hide last_execution attributes Show last_execution attributes object
              • successful boolean Required
              • timestamp
              • reason string
            • last_successful_execution object
              Hide last_successful_execution attributes Show last_successful_execution attributes object
              • successful boolean Required
              • timestamp
              • reason string
            • last_throttle object
              Hide last_throttle attributes Show last_throttle attributes object
              • reason string Required
              • timestamp
        • last_checked string | number

          A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

          One of:

          Time unit for milliseconds

        • last_met_condition string | number

          A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

          One of:

          Time unit for milliseconds

        • state object Required
          Hide state attributes Show state attributes object
          • active boolean Required
          • timestamp string | number Required

            A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

            One of:

            Time unit for milliseconds

        • 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.

      • throttle_period_in_millis number

        Time unit for milliseconds

      • transform object
        Hide transform attributes Show transform attributes object
        • chain array[object]
        • script object
          Hide script attributes Show script attributes object
          • lang string
          • params object
            Hide params attribute Show params attribute object
            • * object Additional properties
          • source string | object

            One of:
          • id string
      • trigger object Required
        Hide trigger attribute Show trigger attribute object
        • schedule object
          Hide schedule attributes Show schedule attributes object
          • timezone string
          • cron string
          • daily object
            Hide daily attribute Show daily attribute object
            • at array[string | object] Required

              A time of day, expressed either as hh:mm, noon, midnight, or an hour/minutes structure.

          • hourly object
            Hide hourly attribute Show hourly attribute object
            • minute array[number] Required
          • interval 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.

          • monthly object | array[object]

            One of:
          • weekly object | array[object]

            One of:
          • yearly object | array[object]

            One of:
    • _primary_term number
    • _seq_no number
    • _version number
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"
        }
      }
    }
  }
}