# Watcher input index wildcard

**URL:** <https://discuss.elastic.co/t/watcher-input-index-wildcard/84777>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [May 5, 2017, 8:20pm UTC](https://discuss.elastic.co/t/watcher-input-index-wildcard/84777 "2017-05-05T20:20:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![piyush](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@piyush](https://discuss.elastic.co/u/piyush)\
**Post date:** [May 5, 2017, 8:20pm UTC](https://discuss.elastic.co/t/watcher-input-index-wildcard/84777/1 "2017-05-05T20:20:48Z")

</div>

Hi Team,  
I am trying to put an alert on ERROR patterns. There are 4 development environments and i have to write 4 alerts for the same pattern search. Can we write an alert on multiple indexes?  
If yes, how to put index name in watcher:

Alert input, (it's not working):  
"indices": [  
"\<env-\*-json-log-{now/d}\>"  
],

---\*\*\*  
\<\env-_-json-log-{now/d}\>  
---_\*\*

Indices are:  
env-dev-json-log-2017.05.05  
env-test-json-log-2017.05.05  
env-qat-json-log-2017.05.05  
env-uat-json-log-2017.05.05

Thanks & Regards,

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [May 15, 2017, 9:10pm UTC](https://discuss.elastic.co/t/watcher-input-index-wildcard/84777/2 "2017-05-15T21:10:21Z")

</div>

Hey,

this query will most likely not work in Elasticsearch either, so this is not directly a watcher issue. What you could do, is to write your watch and specify the environment as part of the [watch metadata](https://www.elastic.co/guide/en/watcher/2.4/watch-definition.html), so that your four watches stay the same otherwise.

Alternatively you could also execute all four queries in one watch using a chained input.

Hope this helps!

--Alex

---

<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:** [June 12, 2017, 9:24pm UTC](https://discuss.elastic.co/t/watcher-input-index-wildcard/84777/3 "2017-06-12T21:24:03Z")

</div>

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