# Index template with date attached to end

**URL:** <https://discuss.elastic.co/t/index-template-with-date-attached-to-end/285708>\
**Category:** Elasticsearch\
**Created:** [October 1, 2021, 6:34pm UTC](https://discuss.elastic.co/t/index-template-with-date-attached-to-end/285708 "2021-10-01T18:34:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 1, 2021, 6:34pm UTC](https://discuss.elastic.co/t/index-template-with-date-attached-to-end/285708/1 "2021-10-01T18:34:09Z")

</div>

I am trying to put template which can be use to rotate index. these are the steps but not working

```auto
PUT _index_template/system-fs
{
  "template": {
    "settings": {
      "index": {
        "lifecycle": {
          "name": "system-fs",
          "rollover_alias": "system-fs"
        },
        "number_of_shards": "7",
        "number_of_replicas": "1"
      }
    }
  },
  "index_patterns": [
    "system-fs-*"
  ],
  "composed_of": []
}

```

Then ilm policy

```auto
PUT _ilm/policy/system-fs
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "rollover": {
            "max_size": "100gb",
            "max_age": "30d"
          }
        }
      },
      "warm": {
        "min_age": "1d",
        "actions": {
          "set_priority": {
            "priority": 60
          },
          "allocate": {
            "number_of_replicas": 0
          }
        }
      }
    }
  }
}

```

But my index which I use via logstash gets created named "system-fs" without any date? how do I put a date

one of my metricbeat index work like that but then all thing is setup via metricbeat.yml file

setup.ilm.pattern: "{now/d}-000001"

Where do I put this setup in my PUT command?

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [October 1, 2021, 7:07pm UTC](https://discuss.elastic.co/t/index-template-with-date-attached-to-end/285708/2 "2021-10-01T19:07:08Z")

</div>

I was missing this part after both of above.

```auto
PUT %3Csystem-fs-%7Bnow%2Fd%7D-000001%3E
{
  "aliases": {
    "system-fs": {
      "is_write_index": true
    }
  }
}

```

---

<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:** [October 29, 2021, 7:07pm UTC](https://discuss.elastic.co/t/index-template-with-date-attached-to-end/285708/3 "2021-10-29T19:07:47Z")

</div>

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