# Several conditions in Condition part of Watcher

**URL:** <https://discuss.elastic.co/t/several-conditions-in-condition-part-of-watcher/148419>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [September 13, 2018, 7:52am UTC](https://discuss.elastic.co/t/several-conditions-in-condition-part-of-watcher/148419 "2018-09-13T07:52:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_Sergey](https://avatars.discourse-cdn.com/v4/letter/_/e68b1a/32.png) [@\_Sergey](https://discuss.elastic.co/u/_Sergey)\
**Post date:** [September 13, 2018, 7:52am UTC](https://discuss.elastic.co/t/several-conditions-in-condition-part-of-watcher/148419/1 "2018-09-13T07:52:26Z")

</div>

Hey community,

Can you advise please: is it possible or what is the correct way to mention in Condition part of watcher several conditions (sorry for tautology).

I want to use smth like this:

> "condition": {  
> "script": {  
> "source": "if (ctx.payload.aggregations.check.buckets.third.uniq.value == 1 || ctx.payload.aggregations.check.buckets.first.uniq.value == 1 || ctx.payload.aggregations.check.buckets.second.uniq.value == 1 || ctx.payload.aggregations.check.buckets.fourth.uniq.value == 1) return true; return false;",  
> "lang": "painless" }}

This not work. Only works if I use one OR (||):

`("if (ctx.payload.aggregations.check.buckets.third.uniq.value == 1 || ctx.payload.aggregations.check.buckets.first.uniq.value == 1)`

So I want to notify me if some of checks is equal 1.

---

<div class="post-metadata">

**Author:** ![\_Sergey](https://avatars.discourse-cdn.com/v4/letter/_/e68b1a/32.png) [@\_Sergey](https://discuss.elastic.co/u/_Sergey)\
**Post date:** [September 13, 2018, 8:19am UTC](https://discuss.elastic.co/t/several-conditions-in-condition-part-of-watcher/148419/2 "2018-09-13T08:19:15Z")

</div>

Hey, Sorry for my fault.

All is work when I use several || in condition.

---

<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:** [October 11, 2018, 8:19am UTC](https://discuss.elastic.co/t/several-conditions-in-condition-part-of-watcher/148419/3 "2018-10-11T08:19:29Z")

</div>

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