# DateMath in Watcher Definition for Index name

**URL:** <https://discuss.elastic.co/t/datemath-in-watcher-definition-for-index-name/205914>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [October 30, 2019, 4:28pm UTC](https://discuss.elastic.co/t/datemath-in-watcher-definition-for-index-name/205914 "2019-10-30T16:28:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Riley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_riley/32/56782_2.png) [@Andrew\_Riley](https://discuss.elastic.co/u/Andrew_Riley)\
**Post date:** [October 30, 2019, 4:28pm UTC](https://discuss.elastic.co/t/datemath-in-watcher-definition-for-index-name/205914/1 "2019-10-30T16:28:04Z")

</div>

I'm trying to set up a watcher that searches a filebeat index with a date in the name.

The watcher itself is executing, but not firing, and I'm concerned that it's because the index isn't being resolved correctly.

The indices name is defined as

\<filebeat-\*-{now/d}\>

When retrieving the watcher via the GET /\_xpack/watcher/watch/name/ or POST /\_xpack/watcher/watch/name/\_execute endpoint, the index name isn't translated, but still appears as \<filebeat-\*-{now/d}\>.

Is there something wrong with this set up?

---

<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:** [October 31, 2019, 12:55pm UTC](https://discuss.elastic.co/t/datemath-in-watcher-definition-for-index-name/205914/2 "2019-10-31T12:55:32Z")

</div>

This is ok and expected. it will only be translated once the search is executed on the elasticsearch side when the watch executes.

---

<div class="post-metadata">

**Author:** ![Andrew\_Riley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_riley/32/56782_2.png) [@Andrew\_Riley](https://discuss.elastic.co/u/Andrew_Riley)\
**Post date:** [October 31, 2019, 4:43pm UTC](https://discuss.elastic.co/t/datemath-in-watcher-definition-for-index-name/205914/3 "2019-10-31T16:43:14Z")

</div>

Thanks, that at least means what I'm seeing isn't wrong. And it does seem to be working now that I've widened some search parameters.

---

<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:** [November 28, 2019, 4:43pm UTC](https://discuss.elastic.co/t/datemath-in-watcher-definition-for-index-name/205914/4 "2019-11-28T16:43:19Z")

</div>

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