# Indeces with current date while using Index Life Management with file beat

**URL:** <https://discuss.elastic.co/t/indeces-with-current-date-while-using-index-life-management-with-file-beat/289222>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [November 15, 2021, 6:32pm UTC](https://discuss.elastic.co/t/indeces-with-current-date-while-using-index-life-management-with-file-beat/289222 "2021-11-15T18:32:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shi](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@shi](https://discuss.elastic.co/u/shi)\
**Post date:** [November 15, 2021, 6:32pm UTC](https://discuss.elastic.co/t/indeces-with-current-date-while-using-index-life-management-with-file-beat/289222/1 "2021-11-15T18:32:24Z")

</div>

For bootstrapping an index for using ILM, with filebeat , the following command was used

```auto
PUT lp_index-otherfgtraffull-000001
{
  "aliases": {
    "lp_index-otherfgtraffull": {
      "is_write_index": true
    }
  }
}

```

Is it possibe to include an **automatic current date** also in **lp\_index-otherfgtraffull-000001**  
so that it will look like **lp\_index-otherfgtraffull-15-11-2021-000001**.  
The current alias index is **lp\_index-otherfgtraffull**.  
Thanks and regards  
shini

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [November 15, 2021, 7:19pm UTC](https://discuss.elastic.co/t/indeces-with-current-date-while-using-index-life-management-with-file-beat/289222/2 "2021-11-15T19:19:55Z")

</div>

Think you are looking for this.

```auto
PUT /%3Clp_index-otherfgtraffull-%7Bnow%2Fd%7D-000001%3E
{
  "aliases": {
    "lp_index-otherfgtraffull": {
      "is_write_index": true
    }
  }
}

```

The URL has to be encoded but this is what it looks like decoded to give you an idea of what it's doing.

`/<lp_index-otherfgtraffull-{now/d}-000001>`

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 15, 2021, 10:20pm UTC](https://discuss.elastic.co/t/indeces-with-current-date-while-using-index-life-management-with-file-beat/289222/3 "2021-11-15T22:20:51Z")

</div>

Just FYI, that date will not change if things roll over. It will only ever be the day that the policy was first invoked.

---

<div class="post-metadata">

**Author:** ![shi](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@shi](https://discuss.elastic.co/u/shi)\
**Post date:** [November 16, 2021, 3:20pm UTC](https://discuss.elastic.co/t/indeces-with-current-date-while-using-index-life-management-with-file-beat/289222/4 "2021-11-16T15:20:05Z")

</div>

ok.. that means we can increment only the number if we use automatic roll over for indices?  
thanks and regrads  
shini

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [November 16, 2021, 7:44pm UTC](https://discuss.elastic.co/t/indeces-with-current-date-while-using-index-life-management-with-file-beat/289222/5 "2021-11-16T19:44:43Z")

</div>

If you using `/<lp_index-otherfgtraffull-{now/d}-000001>` it will look like this if you have a 7 day rollover.

`lp_index-otherfgtraffull-2021.11.16-000001`  
`lp_index-otherfgtraffull-2021.11.23-000002`  
`lp_index-otherfgtraffull-2021.11.30-000003`

The date will change to `NOW` when the new index is created for the rollover and the number will increment.

---

<div class="post-metadata">

**Author:** ![shi](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@shi](https://discuss.elastic.co/u/shi)\
**Post date:** [November 28, 2021, 4:05pm UTC](https://discuss.elastic.co/t/indeces-with-current-date-while-using-index-life-management-with-file-beat/289222/6 "2021-11-28T16:05:34Z")

</div>

Thanks sir. I tried this method..  
understood the url encoding of

```auto
PUT /%3Clp_index-otherfgtraffull-%7Bnow%2Fd%7D-000001%3E

```

also  
Thanks and regards  
shini

---

<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:** [December 26, 2021, 4:06pm UTC](https://discuss.elastic.co/t/indeces-with-current-date-while-using-index-life-management-with-file-beat/289222/7 "2021-12-26T16:06:26Z")

</div>

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