# How to count two different message and put the value in an email in Watcher

**URL:** <https://discuss.elastic.co/t/how-to-count-two-different-message-and-put-the-value-in-an-email-in-watcher/312743>\
**Category:** Elasticsearch\
**Created:** [August 23, 2022, 9:09pm UTC](https://discuss.elastic.co/t/how-to-count-two-different-message-and-put-the-value-in-an-email-in-watcher/312743 "2022-08-23T21:09:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pshada](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pshada/32/110006_2.png) [@pshada](https://discuss.elastic.co/u/pshada)\
**Post date:** [August 23, 2022, 9:09pm UTC](https://discuss.elastic.co/t/how-to-count-two-different-message-and-put-the-value-in-an-email-in-watcher/312743/1 "2022-08-23T21:09:06Z")

</div>

I have a watcher with query like this  
` { "match_phrase": { "message": { "query": "INITIAL" } } } `  
I want have another query  
` { "match_phrase": { "message": { "query": "FINAL" } } } `  
I want have a total count of each messages and send it via email like this

INITIAL 2

FINAL 3

Please help

---

<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:** [September 20, 2022, 9:09pm UTC](https://discuss.elastic.co/t/how-to-count-two-different-message-and-put-the-value-in-an-email-in-watcher/312743/2 "2022-09-20T21:09:46Z")

</div>

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