# Custom index names with an ILM policy

**URL:** https://discuss.elastic.co/t/custom-index-names-with-an-ilm-policy/241852
**Category:** Beats
**Tags:** filebeat, metricbeat, auditbeat
**Created:** [July 20, 2020, 8:02am UTC](https://discuss.elastic.co/t/custom-index-names-with-an-ilm-policy/241852 "2020-07-20T08:02:23Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![michielM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michielm/32/46127_2.png) [@michielM](https://discuss.elastic.co/u/michielM)
#### Post date: [July 20, 2020, 8:02am UTC](https://discuss.elastic.co/t/custom-index-names-with-an-ilm-policy/241852/1 "2020-07-20T08:02:24Z")

</div>

Hi all, I am trying to setup my elk stack and beats in a way that I can have an ILM policy in combination with custom index names.

For example:  
I want to have the index name filebeat-department-01/01/2000  
and have it closed after 30 days and deleted after 44 days.

But when I create a custom index name like filebeat-department-01/01/2000  
Indexes are getting created automatically every day. Which I do not want since it's much harder to manage.

Is there a way to create custom index names without having daily indexes?

---

<div class="post-metadata">

### Author: ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)
#### Post date: [July 20, 2020, 9:24am UTC](https://discuss.elastic.co/t/custom-index-names-with-an-ilm-policy/241852/2 "2020-07-20T09:24:10Z")

</div>

Hi @michielM 🙂

Maybe you are lacking the ILM pattern? [https://www.elastic.co/guide/en/beats/filebeat/current/ilm.html](https://www.elastic.co/guide/en/beats/filebeat/current/ilm.html) Daily indices are the _way to go_ so it seems like a conceptual problem from your side. If you have an fat index, you cannot close and delete part of it after X days. They way it works is by deleting full indexes. That's how you achieve to have only the last 30 days (last 30 indices)

---

<div class="post-metadata">

### Author: ![michielM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michielm/32/46127_2.png) [@michielM](https://discuss.elastic.co/u/michielM)
#### Post date: [July 27, 2020, 7:53am UTC](https://discuss.elastic.co/t/custom-index-names-with-an-ilm-policy/241852/3 "2020-07-27T07:53:11Z")

</div>

Hi @Mario_Castro, thanks for the quick reply.

I thought that if I wanted to create my own index name, I can't use the ILM anymore?

 ![metricbeat](https://us1.discourse-cdn.com/elastic/original/3X/3/e/3e9edb5d03d6b07a234348a744b16ecf9ecf3830.png)

What would be the right way to configure this? Above you can see the current config.

---

<div class="post-metadata">

### Author: ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)
#### Post date: [July 27, 2020, 8:12am UTC](https://discuss.elastic.co/t/custom-index-names-with-an-ilm-policy/241852/4 "2020-07-27T08:12:46Z")

</div>

Check the parameter `setup.ilm.pattern` in the link above.

EDIT: You can use your own index name and in the image attached you have ILM disabled too.

---

<div class="post-metadata">

### Author: ![michielM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michielm/32/46127_2.png) [@michielM](https://discuss.elastic.co/u/michielM)
#### Post date: [July 27, 2020, 8:35am UTC](https://discuss.elastic.co/t/custom-index-names-with-an-ilm-policy/241852/5 "2020-07-27T08:35:36Z")

</div>

Okay I see,

So do I just put `setup.ilm.enabled: auto`  
and `setup.ilm.pattern: "{now/M{yyyy.MM}}-000001"`

Or am I missing something else here?

---

<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: [August 24, 2020, 10:35am UTC](https://discuss.elastic.co/t/custom-index-names-with-an-ilm-policy/241852/6 "2020-08-24T10:35:39Z")

</div>

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