# Kibana Alert API not handling float value correcly

**URL:** <https://discuss.elastic.co/t/kibana-alert-api-not-handling-float-value-correcly/268141>\
**Category:** Kibana\
**Created:** [March 23, 2021, 9:21pm UTC](https://discuss.elastic.co/t/kibana-alert-api-not-handling-float-value-correcly/268141 "2021-03-23T21:21:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leela\_kumili](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leela_kumili/32/85841_2.png) [@leela\_kumili](https://discuss.elastic.co/u/leela_kumili)\
**Post date:** [March 23, 2021, 9:21pm UTC](https://discuss.elastic.co/t/kibana-alert-api-not-handling-float-value-correcly/268141/1 "2021-03-23T21:21:38Z")

</div>

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

 ![Screen Shot 2021-03-22 at 1.52.11 PM](https://us1.discourse-cdn.com/elastic/original/3X/2/7/2753d6a72122ec17a092a62a0ae384b46c3fce38.png)

But in slack message receive scientific value.

 ![Screen Shot 2021-03-23 at 2.19.30 PM](https://us1.discourse-cdn.com/elastic/original/3X/a/8/a880b53a524c04a5156bee24dcf54c53abfb8dca.png)

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

---

<div class="post-metadata">

**Author:** ![mikecote](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikecote/32/58549_2.png) [@mikecote](https://discuss.elastic.co/u/mikecote)\
**Post date:** [March 29, 2021, 1:34pm UTC](https://discuss.elastic.co/t/kibana-alert-api-not-handling-float-value-correcly/268141/2 "2021-03-29T13:34:00Z")

</div>

Hi, @leela_kumili,

I don't believe you are using Elastic's version of [Alerting](https://www.elastic.co/guide/en/kibana/7.12/alerting-getting-started.html) 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.

---

<div class="post-metadata">

**Author:** ![leela\_kumili](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leela_kumili/32/85841_2.png) [@leela\_kumili](https://discuss.elastic.co/u/leela_kumili)\
**Post date:** [March 30, 2021, 5:07am UTC](https://discuss.elastic.co/t/kibana-alert-api-not-handling-float-value-correcly/268141/3 "2021-03-30T05:07:07Z")

</div>

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.

 ![Screen Shot 2021-03-29 at 10.03.16 PM](https://us1.discourse-cdn.com/elastic/original/3X/3/a/3aba6a72545e204aa48111cba09fe19d2adc35d9.png)

---

<div class="post-metadata">

**Author:** ![mikecote](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikecote/32/58549_2.png) [@mikecote](https://discuss.elastic.co/u/mikecote)\
**Post date:** [March 30, 2021, 7:19pm UTC](https://discuss.elastic.co/t/kibana-alert-api-not-handling-float-value-correcly/268141/4 "2021-03-30T19:19:44Z")

</div>

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](https://github.com/opendistro-for-elasticsearch/alerting-kibana-plugin)

Mike

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 27, 2021, 7:19pm UTC](https://discuss.elastic.co/t/kibana-alert-api-not-handling-float-value-correcly/268141/5 "2021-04-27T19:19:54Z")

</div>

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