the payload is what is returned from the input - this makes it dynamic. If you have a simple input like this
"input" : {
"simple" : {
"foo" : "bar"
}
}
then your payload will be a map like this ctx.payload.foo, which has the value bar.
If your input was a search, then the whole JSON search response will be put into the payload, so that things like ctx.payload.hits.total are accessible or aggregations like in your last example.
Because of the dynamic nature of this there is no reference which fields are available. The data will differ with every input. If you use an HTTP input it is super different than if you use a search input because the data returned looks completely different. That is the reason why we cannot provide and reference to this.
If you need to know, how the data looks like, execute a search without a watch and study the response, same for . the HTTP input.
When execution starts, Watcher creates a watch execution context for the watch. The execution context provides scripts and templates with access to the watch metadata, payload, watch ID, execution time, and trigger information. For more information, see Watch Execution Context.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.