Kibana Alert API not handling float value correcly

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

Hi, @leela_kumili,

I don't believe you are using Elastic's version of Alerting as that UI and the concept of monitors isn't used in our version. I would recommend reaching out to the owner of the Kibana plugin you are using to do your alerting.

Hi @mikecote ,

I am using Monitor option from Kibana UI to create this alert as shown in attached screenshot. Can you direct me to Kibana plugin team or forum who can provide some insight into this issue. Thank you.

Hi, @leela_kumili,

Based on the terminology used in your screenshot, I believe that you're using Open Distro's alerts. I'd suggest opening up an issue in the open distro repo: GitHub - opendistro-for-elasticsearch/alerting-kibana-plugin: 📟 Open Distro for Elasticsearch Kibana Alerting Plugin

Mike

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.