# Target daily index in index\_payload action

**URL:** <https://discuss.elastic.co/t/target-daily-index-in-index-payload-action/68046>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [December 5, 2016, 1:23pm UTC](https://discuss.elastic.co/t/target-daily-index-in-index-payload-action/68046 "2016-12-05T13:23:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Blackwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_blackwell/32/4786_2.png) [@Chris\_Blackwell](https://discuss.elastic.co/u/Chris_Blackwell)\
**Post date:** [December 5, 2016, 1:23pm UTC](https://discuss.elastic.co/t/target-daily-index-in-index-payload-action/68046/1 "2016-12-05T13:23:36Z")

</div>

Is there a way to target a daily index from Watcher's index\_payload action

something like this

```
"actions" : {
    "index_payload" : { 
    "transform": { ... },
    "index" : {
      "index" : "my-index-{{year}}.{{month}}.{{day}}", 
      "doc_type" : "my-type" 
    }
  }
}
```

---

<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:** [December 5, 2016, 1:36pm UTC](https://discuss.elastic.co/t/target-daily-index-in-index-payload-action/68046/2 "2016-12-05T13:36:54Z")

</div>

Hey,

yes, you can use [date math](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/common-options.html#date-math) for your index names.

I'll move this over to the watcher forum as well.

--Alex

---

<div class="post-metadata">

**Author:** ![Chris\_Blackwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_blackwell/32/4786_2.png) [@Chris\_Blackwell](https://discuss.elastic.co/u/Chris_Blackwell)\
**Post date:** [December 5, 2016, 2:57pm UTC](https://discuss.elastic.co/t/target-daily-index-in-index-payload-action/68046/3 "2016-12-05T14:57:14Z")

</div>

ok thanks for the hint.  
I managed to find a slightly better reference.  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/date-math-index-names.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/date-math-index-names.html)

so that gives an index definition that looks like this

```
"index": {
  "index": "<my-index-{now/d}>",
  "doc_type": "my-type"
}
```

---

<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:** [January 2, 2017, 2:57pm UTC](https://discuss.elastic.co/t/target-daily-index-in-index-payload-action/68046/4 "2017-01-02T14:57:20Z")

</div>

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