Hi @mohanr
FIrst what kind of alert did you create? Did you create it from the Metrics App it should be of type Metric Threshold.
Here is my config on 7.8.1
Here is my action message complete with a little cool URL to open detailed metrics on host that created the alert (BTW, in future please paste the txt version of your config / results much easier for others to help with)
{
"message": "On host : {{context.group}} {{context.metricOf.condition0}} has crossed a threshold of {{context.thresholdOf.condition0}}, Current value is {{context.valueOf.condition0}}",
"alertId": "{{alertId}}",
"alertName": "{{alertName}}",
"notifygroup": "{{tags}}",
"target": "{{context.group}}",
"metric": "{{context.metricOf.condition0}}",
"current_value": "{{context.valueOf.condition0}}",
"threshold": "{{context.thresholdOf.condition0}}",
"severity": "Warning",
"eventsource": "elasticsearch",
"url" : http://localhost:5601/app/metrics/detail/host/{{context.group}}?metricTime=(autoReload:!f,refreshInterval:5000,time:(from:now-1h,to:now))"
}
You will notice the condition0
on the end that is because the alert creates and object since these alerts are created per host. They documentation does not really explain that, apologies... but if / when you do a new action you will see the condition0
but it does not show in the context menu
{{alertName}} - {{context.group}}
{{context.metricOf.condition0}} has crossed a threshold of {{context.thresholdOf.condition0}}
Current value is {{context.valueOf.condition0}}
And my results
{
"message": "On host : ceres-2.local cpu has crossed a threshold of 5, Current value is 10.5%",
"alertId": "dec67da3-6d9b-4c56-997b-13bc925aef79",
"alertName": "test-cpu-alert",
"notifygroup": "",
"target": "ceres-2.local",
"metric": "cpu",
"current_value": "10.5%",
"threshold": "5",
"severity": "Warning",
"eventsource": "elasticsearch",
"url" : http://localhost:5601/app/metrics/detail/host/ceres-2.local?metricTime=(autoReload:!f,refreshInterval:5000,time:(from:now-1h,to:now))"
}
Hope that helps, plus you got and extra URL goodie
Finally if you could I would get to 7.9.2 there was a lot of additional Alerting capability released especially in the metrics area, where you can test your alert, see the current values vs threshold, automatically get alerted if the metrics stop, but be carefull some of the meta data / context names have changed a little
Here is my alerts for 7.9.2 some slight differences
{
"message": "On host {{context.group}}, {{context.reason}}",
"alertId": "{{alertId}}",
"alertName": "{{alertName}}",
"notifygroup": "{{tags}}",
"target": "{{context.group}}",
"metric": "{{context.metric.condition0}}",
"current_value": "{{context.value.condition0}}",
"threshold": "{{context.threshold.condition0}}",
"severity": "Warning",
"eventsource": "elasticsearch",
"url" : http://localhost:5601/app/metrics/detail/host/{{context.group}}?metricTime=(autoReload:!f,refreshInterval:5000,time:(from:now-1h,to:now))"
}