I am using elastic search open distro.This is my trigger condition :
for (int i = 0; i < ctx.results[0].hits.hits.length; i++) {
if(2 < ctx.results[0].hits.hits[i]._source.responseTime) {
score = true;
} else {
score = false;
}
}
return score;
I am trying to send the message with the specific details of my source with the API url and response time, something like below just for all raised alerts(how do we ensure that):
Monitor {{ctx.monitor.name}} just entered alert status. Please investigate the issue.
- **API Url : {{ctx.results.0.hits.hits.0._source.msg}} and response time {{ctx.results.0.hits.hits.0._source.responseTime}}** -- **need details only for raised alerts**
- Trigger: {{ctx.trigger.name}}
- Severity: {{ctx.trigger.severity}}