🔎 Open source distributed and RESTful search engine.
Go to file
uboness 54fddac93f Add array access support for mustache templates
The default mustache template that is supported by elasticsearch doesn't support array/list access. This poses a real limitation for watcher as with `search` input, the hits are returned as an array/list. To bypass this limitation, an extra (tedious) step is required in order to transform the hits to a data structure that is supported by mustache.

This commit adds a new mustache script engine - `xmustache` to elasticsearch that supports array/list access in the form of `array.X` where `X` is the index into the array/list. This enables accessing the search results without using a transform. The following example will fetch the `"key"` field of the 3rd hit in the search result: `ctx.payload.hits.hits.3._source.key`.

This array/list support will be added to elasticsearch, but it'll only be available in later versions. For now, the default template in watcher will therefore be `xmustache`.

Added docs for templates

Fixes elastic/elasticsearch#230

Original commit: elastic/x-pack-elasticsearch@b09cad7f8b
2015-04-21 23:08:19 +02:00
dev-tools Add missing license check files. 2014-11-07 10:57:59 +00:00
rest-api-spec Persist the Watch.Status if needed after execution 2015-04-16 16:57:14 -04:00
src Add array access support for mustache templates 2015-04-21 23:08:19 +02:00
LICENSE.txt Initial X-Pack commit 2018-04-20 14:16:58 -07:00
README.asciidoc [docs] added docs for input, schedule and condition 2015-03-19 12:07:20 -07:00
all-signatures.txt [cleanup] - added forbidden apis mvn plugin 2015-02-17 16:31:18 +01:00
core-signatures.txt [cleanup] - added forbidden apis mvn plugin 2015-02-17 16:31:18 +01:00
pom.xml Build: removed -XX:MaxPermSize option from pom.xml 2015-04-07 13:41:51 +02:00
test-signatures.txt [cleanup] - added forbidden apis mvn plugin 2015-02-17 16:31:18 +01:00
tests.policy Build: Configure randomizedtesting properly 2014-11-07 14:24:56 +01:00

README.asciidoc

= Elasticsearch Alerts Plugin

This plugins adds alerting features to elasticsearch

You can build the plugin with `mvn package`.

The documentation is put in the `docs/` directory.