I am trying to create a watcher in our elastic cloud 7.17.3 env to get an alert when there is no data in the indices. The problem here is i have more than 50 indices in the cluster and it will be difficult to create a individual alert for each index. So i thought of using a filters aggregation and created filters for all the 50 indices using application name in each index.
Now i will get if any application index is having 0 count. Now i need to use a condition to check the buckets which is having zero count and return them in the watcher body. Could you please let me know how can i achieve this. I have tried array comparison but the resulting output from filters aggregation is not an array it's a json object.
Yes, the approach is the one you just described. You can use aggregations and then the ouput will be a bucket (type object). To apply the conditions, you can use the paintless script that will browse your bucket. And to perhaps also use the transformations that can make it easier for you to format the email template as a mustache.
I have tried to create the script to pick the filters buckets which has zero values but i am getting compile errors. Could you please help me with the script to fetch the buckets which has zero values.
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.