# Need help to modify the Mustache Condition

**URL:** <https://discuss.elastic.co/t/need-help-to-modify-the-mustache-condition/217033>\
**Category:** Kibana\
**Created:** [January 29, 2020, 3:56pm UTC](https://discuss.elastic.co/t/need-help-to-modify-the-mustache-condition/217033 "2020-01-29T15:56:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priyan\_Murugan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priyan_murugan/32/61218_2.png) [@Priyan\_Murugan](https://discuss.elastic.co/u/Priyan_Murugan)\
**Post date:** [January 29, 2020, 3:56pm UTC](https://discuss.elastic.co/t/need-help-to-modify-the-mustache-condition/217033/1 "2020-01-29T15:56:28Z")

</div>

Hi I have the below mustache script for my slack notification message.

Total hits: {{#ctx.results}}{{#hits}}{{total}}{{/hits}}{{/ctx.results}}  
Period start: {{ctx.periodStart}}  
Period end: {{ctx.periodEnd}}  
Error Details:  
{{#ctx.results}}  
{{#hits}}  
{{#hits}}  
{{#\_source}}  
StoreId: {{StoreId}}  
Env: {{Env}}  
App: {{App}} :  
LogType: {{LogType}}  
LogTime: {{LogTime}}  
LogDetails: {{LogDetails}}  
{{/\_source}}  
{{/hits}}  
{{/hits}}  
{{/ctx.results}}  
In this alerts are generating for same error for the same Store ID. I am trying to give some condition to filter only one store id with the same error.

Error Output now

Error Details:  
StoreId: 32294  
Env: prod  
App: V2HH :  
LogType: PRINTING\_ERROR  
LogTime: 2020-01-28T21:09:25  
LogDetails: Printing Label is failed 2 time and error: Error: Error Domain=UIPrintErrorDomain Code=4 "(null)"  
StoreId: 32294  
Env: prod  
App: V2HH :  
LogType: PRINTING\_ERROR  
LogTime: 2020-01-28T21:08:52  
LogDetails: Printing Label is failed 2 time and error: Error: Error Domain=UIPrintErrorDomain Code=4 "(null)"  
StoreId: 32294  
Env: prod  
App: V2HH :  
LogType: PRINTING\_ERROR  
LogTime: 2020-01-28T21:08:33  
LogDetails: Printing Label is failed 2 time and error: Error: Error Domain=UIPrintErrorDomain Code=4 "(null)"  
Need to display only one error out of these three error. Any suggestions on the mustache script to be modified to?

---

<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:** [February 26, 2020, 4:10pm UTC](https://discuss.elastic.co/t/need-help-to-modify-the-mustache-condition/217033/2 "2020-02-26T16:10:41Z")

</div>

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