I have created a monitor in Kibana using ES query
Blockquote
{
"size": 0,
"aggregations": {
"byType": {
"terms": {
"field": "type.keyword",
"size": 10,
"min_doc_count": 1,
"shard_min_doc_count": 0,
"show_term_doc_count_error": false,
"order": [
{
"_count": "desc"
},
{
"_key": "asc"
}
]
},
"aggregations": {
"byStatus": {
"terms": {
"field": "status.keyword",
"size": 10,
"min_doc_count": 1,
"shard_min_doc_count": 0,
"show_term_doc_count_error": false,
"order": [
{
"_count": "desc"
},
{
"_key": "asc"
}
]
},
"aggregations": {
"totalPrice": {
"sum": {
"field": "price"
}
}
}
}
}
}
}
}
Blockquote
Here is the result of the query:
Blockquote
{
"_shards": {
"total": 5,
"failed": 0,
"successful": 5,
"skipped": 0
},
"hits": {
"hits": ,
"total": {
"value": 9,
"relation": "eq"
},
"max_score": null
},
"took": 2,
"timed_out": false,
"aggregations": {
"byType": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"doc_count": 9,
"key": "E",
"byStatus": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"doc_count": 9,
"totalPrice": {
"value": 11111108.625
},
"key": "Processed"
}
]
}
}
]
}
}
}
Blockquote
When define slack alert as action for monitor in message preview it shows values correctly
But in slack message receive scientific value.
Looks like the alert api is generating action result with scientific value
Request URL : https://{{ES_HOST}}/_plugin/kibana/api/alerting/monitors/_execute?dryrun=false
Response payload
Need recommendation how to get correct value in slack message.
Blockquote
{
"ok": true,
"resp": {
"monitor_name": "TestingSampleTX",
"period_start": 1616533937026,
"period_end": 1616533997026,
"error": null,
"input_results": {
"results": [
{
"shards": {
"total": 5,
"failed": 0,
"successful": 5,
"skipped": 0
},
"hits": {
"hits": [],
"total": {
"value": 9,
"relation": "eq"
},
"max_score": null
},
"took": 1,
"timed_out": false,
"aggregations": {
"byType": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"doc_count": 9,
"key": "E",
"byStatus": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"doc_count": 9,
"totalPrice": {
"value": 11111108.625
},
"key": "Processed"
}
]
}
}
]
}
}
}
],
"error": null
},
"trigger_results": {
"O-yW3gB15ff_iZGslUi": {
"name": "sample trigger",
"triggered": true,
"error": null,
"action_results": {
"9_HuYHgBsgPOzpSrqjtM": {
"id": "9_HuYHgBsgPOzpSrqjtM",
"name": "slack alert",
"output": {
"subject": "",
"message": "Total Price By Promotion and Status\nPromotion Type: E\n - Status: Processed : Total Price: 1.1111108625E7$\n",
"messageId": "ok"
},
"throttled": false,
"executionTime": 1616533997010,
"error": null
}
}
}
}
}
}
Blockquote