# Add aliases to filebeat template?

**URL:** https://discuss.elastic.co/t/add-aliases-to-filebeat-template/161867
**Category:** Beats
**Tags:** filebeat
**Created:** [December 21, 2018, 3:12pm UTC](https://discuss.elastic.co/t/add-aliases-to-filebeat-template/161867 "2018-12-21T15:12:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![AlanW](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@AlanW](https://discuss.elastic.co/u/AlanW)
#### Post date: [December 21, 2018, 3:12pm UTC](https://discuss.elastic.co/t/add-aliases-to-filebeat-template/161867/1 "2018-12-21T15:12:19Z")

</div>

Is there any way to set an index alias when configuring a template in filebeat.yml?  
According to [https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-template.html](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-template.html) we can set the number of shards and replicashards etc, but no mention to set an aliases.

We are currently using filebeat to send logs to elasticsearch and want to try to to use the rollover API which requires a source alias in our indices.  
Indiceses that are created from filebeat does not contain any aliases.  
Am i missing something from the docs? How to add an alias in filebeat.yml, like:  
setup.template.pattern: "test-\*"  
setup.template.settings:  
index.aliases: "aliasname"

If this is not supported, can we update or add just the alias later from elasticsearch dev tools without overwriting the template?

Thanks,  
Alan

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [December 25, 2018, 5:57am UTC](https://discuss.elastic.co/t/add-aliases-to-filebeat-template/161867/2 "2018-12-25T05:57:21Z")

</div>

Why don't you create the index manually and then configure the rollover write alias in Filebeat? You should after all only need to create the index once.

---

<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: [January 22, 2019, 6:02am UTC](https://discuss.elastic.co/t/add-aliases-to-filebeat-template/161867/3 "2019-01-22T06:02:24Z")

</div>

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