Changing Inputs
editChanging Inputs
editWatcher supports three types of inputs simple, search, and http.
Loading Static Data with the Simple Input
editTo load static data into the watch payload for testing purposes, you can use the simple input. For example, the following input stores three fields in the payload:
"input" : { "simple" : { "color" : "red", "status" : "error", "count" : 3 } }
Loading Search Results with the Search Input
editTo load search results into the watch payload, you use the search
input. In addition to simple
match queries like the one shown in the Getting Started guide, you can use the
full Elasticsearch query language.
A search input contains a request
object that specifies the indices you want to
search, the search type, and the search request body. The
body
field of a search input is the same as the body of an Elasticsearch _search
request.
The default search type is count
, which
differs from the Elasticsearch default of query_then_fetch
.
Loading a Webserver Response with the HTTP Input
editTo query a webserver and load the response into the watch payload, you use the http
input. In
addition to calling Elasticsearch APIs as shown in the Getting Started
guide, you can submit requests to any webserver that returns a response in JSON.