- Watcher Reference for 2.x and 1.x:
- Introduction
- Getting Started
- Customizing Watches
- How Watcher Works
- Installing Watcher
- Administering Watcher
- Configuring Watcher to Send Email
- Configuring Watcher to Send Messages to HipChat
- Configuring Watcher to Send Messages to Slack
- Configuring Watcher to Send PagerDuty Events
- Integrating Watcher with Shield
- Integrating Watcher with Logstash
- Configuring the Default Throttle Period
- Configuring the Default HTTP Timeouts
- Configuring the Default Internal Operations Timeouts
- Getting Watcher Statistics
- Monitoring Watch Execution
- Managing Watches
- Example Watches
- Reference
- Managing Your License
- Limitations
- Troubleshooting
- Release Notes
From version 5.0 onward, Watcher is part of X-Pack. For more information, see
Alerting on cluster and index events.
Changing Conditions
editChanging Conditions
editWatcher supports four types of conditions always, never, compare, and script.
The first two are pretty self-explanatory—they are shortcuts for setting a watch’s condition to
true
or false
.
The compare
condition enables you to perform simple comparisons against values in the Watch
payload. While you can also do this with a script
condition, with compare
you can define
inline comparisons without having to enable dynamic scripting. You can use the script
condition
to perform more complex evaluations of the data in the watch payload.
For example, the following compare condition checks to see if the search input returned any hits:
"condition" : { "compare" : { "ctx.payload.hits.total" : { "gt" : 0 }} },
Was this helpful?
Thank you for your feedback.