# How to create Index Template & ILM Policy for Logstash output in Filebeat

**URL:** <https://discuss.elastic.co/t/how-to-create-index-template-ilm-policy-for-logstash-output-in-filebeat/254857>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 10, 2020, 7:25am UTC](https://discuss.elastic.co/t/how-to-create-index-template-ilm-policy-for-logstash-output-in-filebeat/254857 "2020-11-10T07:25:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksaha](https://avatars.discourse-cdn.com/v4/letter/k/b782af/32.png) [@ksaha](https://discuss.elastic.co/u/ksaha)\
**Post date:** [November 10, 2020, 7:25am UTC](https://discuss.elastic.co/t/how-to-create-index-template-ilm-policy-for-logstash-output-in-filebeat/254857/1 "2020-11-10T07:25:45Z")

</div>

Hi,  
If I set the filebeat output to Logstash and give customize name to the index in the output section of Logstash pipeline code, in that case how to create the index template and ILM policy (For Elasticsearch output in filebeat the index template and ILM policy are automatically applied)?

```auto
input {
    beats {
        port => "5046"
    }
}
output {
    elasticsearch {
        hosts => ["X.X.X.X:9200", "X.X.X.X:9200", "X.X.X.X:9200"]
        index => "test-log"
        user => "username"
        password => "password"
   }
}

```

Thanks.

---

<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:** [December 8, 2020, 9:25am UTC](https://discuss.elastic.co/t/how-to-create-index-template-ilm-policy-for-logstash-output-in-filebeat/254857/2 "2020-12-08T09:25:58Z")

</div>

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