# Keep index template and ILM when using logstash

**URL:** <https://discuss.elastic.co/t/keep-index-template-and-ilm-when-using-logstash/239736>\
**Category:** Logstash\
**Created:** [July 3, 2020, 6:31am UTC](https://discuss.elastic.co/t/keep-index-template-and-ilm-when-using-logstash/239736 "2020-07-03T06:31:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sref](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sref](https://discuss.elastic.co/u/sref)\
**Post date:** [July 3, 2020, 6:31am UTC](https://discuss.elastic.co/t/keep-index-template-and-ilm-when-using-logstash/239736/1 "2020-07-03T06:31:51Z")

</div>

Im looking for guidance on how to keep ILM working, when sending logs via Logstash to a custom index.

I do the classic setup with Winlogbeat-\>Logstash-\>ES.  
Logstash output config:

```
output {
  if "CUSTOMTAG" in [tags] {
    elasticsearch {
      ssl => true
      cacert => '/etc/logstash/certs/ca.crt'
      #manage_template => true
      hosts => ["ES1fqdn:9200", "ES2.fqdn:9200", "ES2.fqdn:9200"]
      index => "COMPANYNAME-%{[@metadata][beat]}-%{[@metadata][version]}"
      user => "logstash_writer"
      password => "PASSWORD"
    }
  }

```

I read on some blog that i maybe should add the following lines to output:  
template =\> "/myconfig/template.json"  
template\_name =\> "myindex"  
template\_overwrite =\> "true"

template.json is the winlogbeat index template that i exported from winlogbeat

Im basically looking for daily indexes following the pattern "COMPANYNAME-Winlogbeat-YY-MM-DD  
Using ILM rollover to create extra indexes suffixed 00001, 00002 etc if it needs to create multiple indices that day

Am i confusing the older way to manage index rollover with ILM, or am i totally on the wrong path?

---

<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 31, 2020, 6:31am UTC](https://discuss.elastic.co/t/keep-index-template-and-ilm-when-using-logstash/239736/2 "2020-07-31T06:31:57Z")

</div>

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