# Watcher Condition Examples

**URL:** <https://discuss.elastic.co/t/watcher-condition-examples/1432>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [May 27, 2015, 11:43pm UTC](https://discuss.elastic.co/t/watcher-condition-examples/1432 "2015-05-27T23:43:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prashant\_sharma](https://avatars.discourse-cdn.com/v4/letter/p/ea666f/32.png) [@prashant\_sharma](https://discuss.elastic.co/u/prashant_sharma)\
**Post date:** [May 27, 2015, 11:43pm UTC](https://discuss.elastic.co/t/watcher-condition-examples/1432/1 "2015-05-27T23:43:13Z")

</div>

Are there any use cases/examples of Watcher Conditions handling with Payload Data?

---

<div class="post-metadata">

**Author:** ![uboness](https://avatars.discourse-cdn.com/v4/letter/u/96bed5/32.png) [@uboness](https://discuss.elastic.co/u/uboness)\
**Post date:** [May 28, 2015, 12:53am UTC](https://discuss.elastic.co/t/watcher-condition-examples/1432/2 "2015-05-28T00:53:48Z")

</div>

The simplest use case can be seen in the getting started section in ther reference doc ( [https://www.elastic.co/guide/en/watcher/current/watch-log-data.html#log-add-condition](https://www.elastic.co/guide/en/watcher/current/watch-log-data.html#log-add-condition)). In this example, the `compare` condition simply extracts a value out of the payload and compares it to a given value.

For more complex conditions, you have the `script`. The cookbook section in the docs shows a few examples of evaluating marvel data. The conditions there are quite complex, but it just goes to show how far you can take it (here's one example: [https://www.elastic.co/guide/en/watcher/current/watching-marvel-data.html#watching-cluster-health](https://www.elastic.co/guide/en/watcher/current/watching-marvel-data.html#watching-cluster-health))

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:49pm UTC](https://discuss.elastic.co/t/watcher-condition-examples/1432/3 "2017-07-06T13:49:50Z")

</div>


