# Help Needed: Converting Numeric Aggregation Output to Boolean ("Up"/"Down") in Watcher Email Template

**URL:** <https://discuss.elastic.co/t/help-needed-converting-numeric-aggregation-output-to-boolean-up-down-in-watcher-email-template/370512>\
**Category:** Kibana\
**Created:** [November 14, 2024, 1:08am UTC](https://discuss.elastic.co/t/help-needed-converting-numeric-aggregation-output-to-boolean-up-down-in-watcher-email-template/370512 "2024-11-14T01:08:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sathishkumar\_Kanda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sathishkumar_kanda/32/139204_2.png) [@Sathishkumar\_Kanda](https://discuss.elastic.co/u/Sathishkumar_Kanda)\
**Post date:** [November 14, 2024, 1:08am UTC](https://discuss.elastic.co/t/help-needed-converting-numeric-aggregation-output-to-boolean-up-down-in-watcher-email-template/370512/1 "2024-11-14T01:08:14Z")

</div>

I’m configuring a watcher and email action in Elasticsearch to monitor the health status of multiple services and send email notifications with the status. Specifically, I need the status to display as either "Up" or "Down" in an HTML table format within the email. However, I’ve encountered an issue with formatting and interpreting the numeric output in the Mustache template.

"status": {  
"bucket\_script": {  
"buckets\_path": {  
"up\_count": "status\_up.\_count",  
"down\_count": "status\_down.\_count"  
},  
"script": "params.up\_count \> 0 ? 1 : 0" // Integer output for Up (1) or Down (0)  
}  
}

Template

{{#status.value}}Up{{/status.value}}{{^status.value}}Down{{/status.value}}

What am seeing is the value is coming as object {value=1.0}, but still its not working

---

<div class="post-metadata">

**Author:** ![Sathishkumar\_Kanda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sathishkumar_kanda/32/139204_2.png) [@Sathishkumar\_Kanda](https://discuss.elastic.co/u/Sathishkumar_Kanda)\
**Post date:** [November 14, 2024, 2:34pm UTC](https://discuss.elastic.co/t/help-needed-converting-numeric-aggregation-output-to-boolean-up-down-in-watcher-email-template/370512/2 "2024-11-14T14:34:03Z")

</div>

Able to achieved using Transform using painless script, i refered anonmolies example given by elastic team
