2018-07-02 17:44:36 -04:00
|
|
|
[[painless-watcher-transform-context]]
|
|
|
|
=== Watcher transform context
|
|
|
|
|
2018-07-25 13:59:25 -04:00
|
|
|
Use a Painless script to {xpack-ref}/transform-script.html[transform] watch
|
2018-07-02 17:44:36 -04:00
|
|
|
data into a new payload for use in a response to a condition.
|
|
|
|
|
|
|
|
*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.
|
|
|
|
|
2018-12-10 20:29:25 -05:00
|
|
|
`ctx['execution_time']` (`ZonedDateTime`, read-only)::
|
2018-07-02 17:44:36 -04:00
|
|
|
The start time for the watch.
|
|
|
|
|
2018-12-10 20:29:25 -05:00
|
|
|
`ctx['trigger']['scheduled_time']` (`ZonedDateTime`, read-only)::
|
2018-07-02 17:44:36 -04:00
|
|
|
The scheduled trigger time for the watch.
|
|
|
|
|
2018-12-10 20:29:25 -05:00
|
|
|
`ctx['trigger']['triggered_time']` (`ZonedDateTime`, read-only)::
|
2018-07-02 17:44:36 -04:00
|
|
|
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*
|
|
|
|
|
|
|
|
`Object`::
|
|
|
|
The new payload.
|
|
|
|
|
|
|
|
*API*
|
|
|
|
|
|
|
|
The standard <<painless-api-reference, Painless API>> is available.
|