Hi,
I am using a Custom Webhook configuration. Where in my inbound API supports the “summary” and “details” attributes in place of “subject_template” and “message_template” in custom webhook integration.
Am able to send the notifications to my webhook endpoint but the Subject & Message details are not showing up. Below is my monitor & destination API’s. Kindly, let me know if am missing something.
Monitor:
POST _plugins/_alerting/monitors
{
"type": "monitor",
"name": "test-goalert-monitor",
"monitor_type": "query_level_monitor",
"enabled": true,
"schedule": {
"period": {
"interval": 1,
"unit": "MINUTES"
}
},
"inputs": [{
"search": {
"indices": ["<index-name>"],
"query": {
"size": 0,
"aggregations": {},
"query": {
"bool": {
"filter": {
"range": {
"@timestamp": {
"gte": "||-1h",
"lte": "",
"format": "epoch_millis"
}
}
}
}
}
}
}
}],
"triggers": [{
"name": "test-trigger",
"severity": "1",
"condition": {
"script": {
"source": "ctx.results[0].hits.total.value > 0",
"lang": "painless"
}
},
"actions": [{
"name": "test-action",
"destination_id": "<dest-id>",
"message_template": {
"source": "This is my testing message body."
},
"subject_template": {
"source": "TESTING"
}
}]
}]
}
Destination:
POST _opendistro/_alerting/destinations
{
"type": "custom_webhook",
"name": "destination-name",
"custom_webhook": {
"path": "api/v2/generic/incoming",
"header_params": {
"enabled": true,
"Content-Type": "application/json"
},
"scheme": "HTTP",
"port": <port-ip>,
"query_params": {
"token": "<token>",
"message_template": "details",
"subject_template" : "summary"
},
"host": "<host>"
}
}