# Unable to change index name for Filebeat

**URL:** <https://discuss.elastic.co/t/unable-to-change-index-name-for-filebeat/122890>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [March 7, 2018, 1:34pm UTC](https://discuss.elastic.co/t/unable-to-change-index-name-for-filebeat/122890 "2018-03-07T13:34:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rudolf\_Reddy\_Macejka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rudolf_reddy_macejka/32/12875_2.png) [@Rudolf\_Reddy\_Macejka](https://discuss.elastic.co/u/Rudolf_Reddy_Macejka)\
**Post date:** [March 7, 2018, 1:34pm UTC](https://discuss.elastic.co/t/unable-to-change-index-name-for-filebeat/122890/1 "2018-03-07T13:34:28Z")

</div>

Hello,

I am trying to change index name for filebeat configuration and it still complain about missing template name and pattern.

After googling and checking documentation I have finished with this configration syntax:  
output.elasticsearch:  
# Array of hosts to connect to.  
hosts: ["localhost:9200"]  
index: "api-access-%{+yyyy.MM.dd}"  
setup.template.enabled: false  
setup.template.name: "api-access"  
setup.template.pattern: "api-access-\*"

But still getting  
2018-03-07T13:28:22.437Z INFO instance/beat.go:475 Beat UUID: 36ef92e0-ca53-4d4b-a7b8-0ec3c105eb62  
2018-03-07T13:28:22.437Z INFO instance/beat.go:213 Setup Beat: filebeat; Version: 6.2.2  
2018-03-07T13:28:22.437Z ERROR instance/beat.go:667 Exiting: setup.template.name and setup.template.pattern have to be set if index name is modified.  
Exiting: setup.template.name and setup.template.pattern have to be set if index name is modified.

Any idea what I am doing wrong?

Thank you,

Reddy

---

<div class="post-metadata">

**Author:** ![adrisr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrisr/32/25423_2.png) [@adrisr](https://discuss.elastic.co/u/adrisr)\
**Post date:** [March 8, 2018, 5:30pm UTC](https://discuss.elastic.co/t/unable-to-change-index-name-for-filebeat/122890/2 "2018-03-08T17:30:34Z")

</div>

It seems that you have an indentation error in your configuration.

This works for me:

```auto
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["localhost:9200"]
  index: "api-access-%{+yyyy.MM.dd}"
setup.template:
  name: 'api-access'
  pattern: 'api-access-*'
  enabled: false

```

---

<div class="post-metadata">

**Author:** ![Lazarbeam](https://avatars.discourse-cdn.com/v4/letter/l/e0b2c6/32.png) [@Lazarbeam](https://discuss.elastic.co/u/Lazarbeam)\
**Post date:** [March 8, 2018, 8:25pm UTC](https://discuss.elastic.co/t/unable-to-change-index-name-for-filebeat/122890/3 "2018-03-08T20:25:18Z")

</div>

Why would setup.template.enabled be false?

Be sure to have created the index template in elasticsearch - I think you have to go through the API to do so. [https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html)

---

<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 5, 2018, 8:25pm UTC](https://discuss.elastic.co/t/unable-to-change-index-name-for-filebeat/122890/4 "2018-04-05T20:25:19Z")

</div>

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