2018-07-02 17:44:36 -04:00
|
|
|
[[painless-watcher-condition-context]]
|
|
|
|
=== Watcher condition context
|
|
|
|
|
2018-07-25 13:59:25 -04:00
|
|
|
Use a Painless script as a {xpack-ref}/condition-script.html[watcher condition]
|
2018-07-02 17:44:36 -04:00
|
|
|
to test if a response is necessary.
|
|
|
|
|
|
|
|
*Variables*
|
|
|
|
|
|
|
|
`params` (`Map`, read-only)::
|
|
|
|
User-defined parameters passed in as part of the query.
|
|
|
|
|
|
|
|
`ctx['watch_id']` (`String`, read-only)::
|
|
|
|
The id of the watch.
|
|
|
|
|
|
|
|
`ctx['execution_time']` (`DateTime`, read-only)::
|
|
|
|
The start time for the watch.
|
|
|
|
|
|
|
|
`ctx['trigger']['scheduled_time']` (`DateTime`, read-only)::
|
|
|
|
The scheduled trigger time for the watch.
|
|
|
|
|
|
|
|
`ctx['trigger']['triggered_time']` (`DateTime`, read-only)::
|
|
|
|
The actual trigger time for the watch.
|
|
|
|
|
|
|
|
`ctx['metadata']` (`Map`, read-only)::
|
|
|
|
Any metadata associated with the watch.
|
|
|
|
|
|
|
|
`ctx['payload']` (`Map`, read-only)::
|
|
|
|
The accessible watch data based upon the
|
2018-07-25 13:59:25 -04:00
|
|
|
{xpack-ref}/input.html[watch input].
|
2018-07-02 17:44:36 -04:00
|
|
|
|
|
|
|
*Return*
|
|
|
|
|
|
|
|
`boolean`::
|
|
|
|
Expects `true` if the condition is met, and `false` otherwise.
|
|
|
|
|
|
|
|
*API*
|
|
|
|
|
|
|
|
The standard <<painless-api-reference, Painless API>> is available.
|