# Handling Multiple Templates in Logstash

**URL:** <https://discuss.elastic.co/t/handling-multiple-templates-in-logstash/1367>\
**Category:** Logstash\
**Created:** [May 27, 2015, 8:34am UTC](https://discuss.elastic.co/t/handling-multiple-templates-in-logstash/1367 "2015-05-27T08:34:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suganthi\_Thangavel](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@Suganthi\_Thangavel](https://discuss.elastic.co/u/Suganthi_Thangavel)\
**Post date:** [May 27, 2015, 8:34am UTC](https://discuss.elastic.co/t/handling-multiple-templates-in-logstash/1367/1 "2015-05-27T08:34:36Z")

</div>

I have two different csv files with few columns having same name but different data types and i created different templates. How to handle both templates in one conf file.  
Please help me.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [May 27, 2015, 5:08pm UTC](https://discuss.elastic.co/t/handling-multiple-templates-in-logstash/1367/2 "2015-05-27T17:08:54Z")

</div>

You have a few options.

You could have two outputs with the flows separated by conditionals. Each output defines its own template.

Or you could just use the REST API to upload your other template: [https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html#indices-templates](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html#indices-templates)

---

<div class="post-metadata">

**Author:** ![Suganthi\_Thangavel](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@Suganthi\_Thangavel](https://discuss.elastic.co/u/Suganthi_Thangavel)\
**Post date:** [May 28, 2015, 6:38am UTC](https://discuss.elastic.co/t/handling-multiple-templates-in-logstash/1367/3 "2015-05-28T06:38:14Z")

</div>

Thank you so much for the reply. I will try that option

---

<div class="post-metadata">

**Author:** ![Suganthi\_Thangavel](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@Suganthi\_Thangavel](https://discuss.elastic.co/u/Suganthi_Thangavel)\
**Post date:** [June 5, 2015, 8:27am UTC](https://discuss.elastic.co/t/handling-multiple-templates-in-logstash/1367/4 "2015-06-05T08:27:35Z")

</div>

I tried the above solution and it works. Thank you so much Aaron 😄

---

<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 6, 2017, 5:38am UTC](https://discuss.elastic.co/t/handling-multiple-templates-in-logstash/1367/5 "2017-07-06T05:38:27Z")

</div>


