# How to use NOT operator in watcher

**URL:** <https://discuss.elastic.co/t/how-to-use-not-operator-in-watcher/165398>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [January 23, 2019, 11:57am UTC](https://discuss.elastic.co/t/how-to-use-not-operator-in-watcher/165398 "2019-01-23T11:57:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![balamelangi](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@balamelangi](https://discuss.elastic.co/u/balamelangi)\
**Post date:** [January 23, 2019, 11:57am UTC](https://discuss.elastic.co/t/how-to-use-not-operator-in-watcher/165398/1 "2019-01-23T11:57:51Z")

</div>

Hi,

Is there any other way to get notification containing  
"match": ["error" NOT "org.apache"]

Thanks.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 23, 2019, 12:12pm UTC](https://discuss.elastic.co/t/how-to-use-not-operator-in-watcher/165398/2 "2019-01-23T12:12:14Z")

</div>

Use a bool query and put the match `"org.apache"` in a `must_not` clause and the match `"error"` in the `must` part.

---

<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 20, 2019, 12:12pm UTC](https://discuss.elastic.co/t/how-to-use-not-operator-in-watcher/165398/3 "2019-02-20T12:12:15Z")

</div>

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