Howdy Open Distro Crew,
I’m currently working through migrating existing watchers from my on-prem ES instance to a new AWS ES instance. I’m having some difficulty understanding all of the members or objects (I apologize for the bastardization of terminology) of the ctx variable that can used during the trigger and alert creation process.
The OpenDistro alerting documentation for monitors mentions that all query results are stored in an array with one element named “ctx.results” but that doesn’t really explain to me all the ways I can use this array. For example, within the same documentation I can see other queries using
ctx.results.aggregations.avg_cpu.value but those use cases are never documented. How am I to know all of the ways I can use the “ctx.results” array?
Second, what is the proper way to return the number of hits a query had within an email subject / body? I believe the proper way is
ctx.results.hits.total. However, when I use this method against a query that returned no results (expected) instead of displaying “0” it doesn’t display anything. Is this expected?
Thank you all for your time.