# Logstash with ILM like old behavior

**URL:** https://discuss.elastic.co/t/logstash-with-ilm-like-old-behavior/174088
**Category:** Logstash
**Created:** [March 27, 2019, 10:26am UTC](https://discuss.elastic.co/t/logstash-with-ilm-like-old-behavior/174088 "2019-03-27T10:26:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![gruselglatz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gruselglatz/32/42675_2.png) [@gruselglatz](https://discuss.elastic.co/u/gruselglatz)
#### Post date: [March 27, 2019, 10:26am UTC](https://discuss.elastic.co/t/logstash-with-ilm-like-old-behavior/174088/1 "2019-03-27T10:26:00Z")

</div>

Hi,

i want to imitate the old logstash behavior with creating daily indices and naming it per day, but only with ILM and deleting it after xx days.

I cant get it to work and i am not really fit with the new ilm settings.

can i do something like this?

```
output {
    elasticsearch {
      ilm_rollover_alias => "logstash-%{+YYYY.MM.dd}"
      ilm_enabled => true
      ilm_policy => "Delete_after_120_days"
      ilm_write_alias => "logstash-"
      ilm_pattern => "%{+YYYY.MM.dd}"
    }
}

```

thanks for your help

---

<div class="post-metadata">

### Author: ![gruselglatz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gruselglatz/32/42675_2.png) [@gruselglatz](https://discuss.elastic.co/u/gruselglatz)
#### Post date: [March 27, 2019, 12:05pm UTC](https://discuss.elastic.co/t/logstash-with-ilm-like-old-behavior/174088/2 "2019-03-27T12:05:34Z")

</div>

OK i think i've got it but with this settings it always creates an index `logstash--2019.03.27-000001`

```
output {
    elasticsearch {
      ilm_rollover_alias => "logstash-"
      ilm_enabled => true
      ilm_policy => "Delete_after_120_days"
      ilm_pattern => "{now/d}-000001"
    }
}

```

I cant get it to create `logstash-2019.03.27-000001` . Without the - in the ilm\_rollover\_alias i only get a index with the name `logstash` .

---

<div class="post-metadata">

### Author: ![gruselglatz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gruselglatz/32/42675_2.png) [@gruselglatz](https://discuss.elastic.co/u/gruselglatz)
#### Post date: [March 27, 2019, 12:44pm UTC](https://discuss.elastic.co/t/logstash-with-ilm-like-old-behavior/174088/3 "2019-03-27T12:44:48Z")

</div>

It worked only after i've deleted every logstash index and deleted all logstash templates

---

<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: [April 24, 2019, 12:44pm UTC](https://discuss.elastic.co/t/logstash-with-ilm-like-old-behavior/174088/4 "2019-04-24T12:44:53Z")

</div>

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