Hi, we have a number of watchers that send notification to rest_api (Service.now) to create an incident.
I would like to create a generic alert that if a watcher cannot send notification or is in Error state (Execution Failing) would send an email out.
The idea is to create a watcher digesting .watcher_history indices but I not sure what a field within that record to use query.
not everything in the watcher history is searchable, so you need to take a look at the mapping to be sure you can actually search and filter on the values you are trying to extract data from.
Do you have a sample query we can work with and see if you can search on the fields you want?
Hi Alex, this is a payload from .watcher-history with the field status.actions.my_webhook.last_execution.successful that if false to trigger an action. Unfortunately currently this field is not indexed. We tried the fields rediscovery and although brought it up from ~130 to 170 fields the one I am interested has not appeared there yet. I have been thinking to create Explicit Mapping but I am still newbie to this and currently researching this option.
if you search for the last 10 watch history entries for this watch, then you do not need to search for the last execution flag. You can just use painless scripting in the condition to check the value of the last 10 entries that are being returned as part of the search.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.