Hello there,
I would like to include a log's field value in the alert body message. The alert is pushed to slack channel. From the log entry below, I wanted to include the payload.message and payload.customData.orders
The log entry
{
"metaData": {
"timestamp": "2020-09-03T12:03:01.193Z",
"appVersion": "0.0.1-SNAPSHOT",
"appName": "order-events-monitor",
"logger": "ForkJoinPool.commonPool-worker-3",
"priority": "ERROR",
"envName": "dev",
"envHost": "localhost",
"tracePoint": "END"
},
"payload": {
"class": "com.handlers.PriceMismatchHandler:42",
"message": "Price mismatch",
"customData": {},
"exception": ""
},
"context": {
"correlationRootId": "29b8c9c6-5780-4cbb-a7ff-b6e02f34e171",
"customData": {
"orders": []
},
"correlationId": "fd889faf-1d70-421d-be51-5ec312b03dfa"
}
}
the configuration for the trigger action is below
Monitor {{ctx.monitor.name}} just entered alert status. Please investigate the issue.
- Message: {{ctx.payload.message}}
- Trigger: {{ctx.trigger.name}}
- Severity: {{ctx.trigger.severity}}
- Period start: {{ctx.periodStart}}
- Period end: {{ctx.periodEnd}}
The above is not printing the value of the payload.mesage. I tried {{ctx.payload.hits}}. If I print out the whole {{ctx}} in the body I get the following:
{monitor={_id=FofyAHQBm5zOLdVNL306, _version=105, name=Inventory File Monitor S307, enabled=true}, trigger={id=GYfzAHQBm5zOLdVNZX1e, name=Inventory File Missing S307, severity=4, actions=[{name=Missing Inventory File from S307}]}, results=[{_shards={total=35, failed=0, successful=35, skipped=0}, hits={hits=[], total={value=2, relation=eq}, max_score=null}, took=8, timed_out=false}], periodStart=2020-08-21T07:44:10.087Z, periodEnd=2020-08-21T07:45:10.087Z, alert={acknowledged_time=null, id=7YT5D3QBnr12y3m8mqFF, version=-1, end_time=null, error_message=null, last_notification_time=1597995850206, severity=4, start_time=1597995850206, state=ACTIVE}, error=null}
Thanks in advance