# Adding conditions dynamically to the watcher

**URL:** <https://discuss.elastic.co/t/adding-conditions-dynamically-to-the-watcher/244872>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [August 13, 2020, 11:25am UTC](https://discuss.elastic.co/t/adding-conditions-dynamically-to-the-watcher/244872 "2020-08-13T11:25:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adityaPsl](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@adityaPsl](https://discuss.elastic.co/u/adityaPsl)\
**Post date:** [August 13, 2020, 11:25am UTC](https://discuss.elastic.co/t/adding-conditions-dynamically-to-the-watcher/244872/1 "2020-08-13T11:25:41Z")

</div>

Hello Team,

Could you please help me understand if adding conditions dynamically to the watcher is possible.  
I will try to explain the scenario. for example if i have 3 status codes for which i am checking the index if i get x number of occurrences within say one day i will raise an alert but if i want to add one more status code or remove the code ore add different date range conditions

```
if create a watch like this (please ignore the syntax)
if status==New and number of records in day == 10 raise an alert 
now i want to add status = updated date range = 2 days threshold = 20 

```

can i create a generic watcher which will read the list with configurable values and raise alert accordingly.

Thank you for your help and support

Aditya

---

<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 10, 2020, 11:25am UTC](https://discuss.elastic.co/t/adding-conditions-dynamically-to-the-watcher/244872/2 "2020-09-10T11:25:44Z")

</div>

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