While creating a Kibana Alert and Trigger I have the following results from an extraction query response...and wondering how to properly use ctx.payload in the message(sending via webhook in slack) to return the Hospital results below..
Currently the message carries...and of course the Results section fails to return anything...
Thanks...
Monitor {{ctx.monitor.name}} just entered alert status. Please investigate the issue.
- Trigger: {{ctx.trigger.name}}
- Severity: {{ctx.trigger.severity}}
- Period start: {{ctx.periodStart}}
- Period end: {{ctx.periodEnd}}
- Results: {{/ctx.payload}}
//Code begins below
{
"_shards": {
"total": 1,
"failed": 0,
"successful": 1,
"skipped": 0
},
"hits": {
"hits": [],
"total": {
"value": 27,
"relation": "eq"
},
"max_score": null
},
"took": 2,
"timed_out": false,
"aggregations": {
"2": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"1": {
"value": 1332
},
"3": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 11,
"buckets": [
{
"1": {
"value": 249
},
"doc_count": 5,
"key": "PRISMA HEALTH PATEWOOD HOSPITAL"
},
{
"1": {
"value": 245
},
"doc_count": 5,
"key": "PRISMA HEALTH GREER MEMORIAL HOSPITAL"
},
{
"1": {
"value": 99
},
"doc_count": 2,
"key": "MUSC HEALTH FLORENCE MEDICAL CENTER"
},
{
"1": {
"value": 98
},
"doc_count": 2,
"key": "ANMED HEALTH"
},
{
"1": {
"value": 98
},
"doc_count": 2,
"key": "PIEDMONT MEDICAL CENTER"
}
]
},
"doc_count": 27,
"key": "hospital"
}
]
}
}
}
//