Changing Inputs

edit

Watcher supports four types of inputs simple, search, http, and chain.

Loading Static Data with the Simple Input

edit

To 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

edit

To 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

edit

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

Chaining Inputs

edit

You can create an input chain to load data from multiple sources into a watch. The inputs in a chain are processed in order, so the the data loaded by one input can be used by subsequent inputs.