# Applying ILM on custom index

**URL:** https://discuss.elastic.co/t/applying-ilm-on-custom-index/334924
**Category:** Elasticsearch
**Tags:** ilm-index-lifecycle-management
**Created:** [June 1, 2023, 8:40am UTC](https://discuss.elastic.co/t/applying-ilm-on-custom-index/334924 "2023-06-01T08:40:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hjazz6](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hjazz6/32/79007_2.png) [@hjazz6](https://discuss.elastic.co/u/hjazz6)
#### Post date: [June 1, 2023, 8:40am UTC](https://discuss.elastic.co/t/applying-ilm-on-custom-index/334924/1 "2023-06-01T08:40:07Z")

</div>

Hi,

I am using filebeat 8.3.3 with several inputs and writing them to the same ES 8.3.3. To separate the different inputs on ES, I have the following in my `filebeat.yml`.

```auto
output.elasticsearch:
  indices:
    - index: "filebeat-%{[agent.version]}-inputA-%{+yyyy.MM.dd}"
      when.equals:
        input.type: "log"
    - index: "filebeat-%{[agent.version]}-inputB-%{+yyyy.MM.dd}"
      when.equals:
        input.type: "filestream"

```

I now have these indices created daily, but ILM is not applied on them, so they can grow to 1-2TB per day.

I've read that ILM doesn't work on custom indices. Is there any workaround to this so that I can apply ILM on these 2 indices and have them be rotated every 50GB and deleted after 7 days?

Thank you.

---

<div class="post-metadata">

### Author: ![Wave](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wave/32/117242_2.png) [@Wave](https://discuss.elastic.co/u/Wave)
#### Post date: [June 5, 2023, 8:06pm UTC](https://discuss.elastic.co/t/applying-ilm-on-custom-index/334924/2 "2023-06-05T20:06:13Z")

</div>

Hi @hjazz6,

ILM supports custom indices but you need to use an alias and often you have to bootstrap the index. See [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-index-lifecycle-management.html#manage-time-series-data-without-data-streams) for the following documentation.

---

<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: [June 6, 2023, 12:25am UTC](https://discuss.elastic.co/t/applying-ilm-on-custom-index/334924/3 "2023-06-06T00:25:04Z")

</div>

Also FWIW there's no value in using `%{+yyyy.MM.dd}` in your index names if you are using ILM as variables won't be used when things are rolled over.

---

<div class="post-metadata">

### Author: ![hjazz6](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hjazz6/32/79007_2.png) [@hjazz6](https://discuss.elastic.co/u/hjazz6)
#### Post date: [June 6, 2023, 7:53am UTC](https://discuss.elastic.co/t/applying-ilm-on-custom-index/334924/4 "2023-06-06T07:53:56Z")

</div>

Thanks, I've removed the date from the index names.

---

<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: [July 4, 2023, 7:54am UTC](https://discuss.elastic.co/t/applying-ilm-on-custom-index/334924/5 "2023-07-04T07:54:28Z")

</div>

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