Following this guide, I have a work alert to OpsGenie when a monitor goes down. However, the alert the is generated is so unhelpful and requires logging into Kibana.
Is there a way to customize the title of the alert that is sent to OpsGenie so that I can include the name of the monitors that triggered the alert?
{
"trigger": {
"schedule": {
"interval": "1m"
}
},
"input": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"heartbeat-*"
],
"rest_total_hits_as_int": true,
"body": {
"query": {
"bool": {
"must": [
{
"term": {
"monitor.status": {
"value": "down"
}
}
}
],
"filter": [
{
"range": {
"@timestamp": {
"from": "now-1m"
}
}
}
]
}
}
}
}
}
},
"condition": {
"compare": {
"ctx.payload.hits.total": {
"gt": 0
}
}
},
"actions": {
"opsgenie": {
"webhook": {
"scheme": "https",
"host": "api.opsgenie.com",
"port": 443,
"method": "post",
"path": "/v1/json/eswatcher",
"params": {
"apiKey": "value"
},
"headers": {
"Content-Type": "application/html"
},
"body": "{{#toJson}}ctx{{/toJson}}"
}
}
}
}