# How load template with logstash using elasticsearch output plugin

**URL:** <https://discuss.elastic.co/t/how-load-template-with-logstash-using-elasticsearch-output-plugin/106325>\
**Category:** Logstash\
**Created:** [November 3, 2017, 2:42pm UTC](https://discuss.elastic.co/t/how-load-template-with-logstash-using-elasticsearch-output-plugin/106325 "2017-11-03T14:42:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![citanionarrei](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@citanionarrei](https://discuss.elastic.co/u/citanionarrei)\
**Post date:** [November 3, 2017, 2:42pm UTC](https://discuss.elastic.co/t/how-load-template-with-logstash-using-elasticsearch-output-plugin/106325/1 "2017-11-03T14:42:45Z")

</div>

hi friends  
i want to load my template on the output of logstash to map correctly my json  
i'm trying this but template is not loaded

```
output {		
    elasticsearch {
index => "ciao-%{+YYYY.MM.dd}"
document_type => "ciao_prova"
manage_template => true
template => "C:\Users\Lock\Desktop\canonicoTemplate\template.json"
template_overwrite => "true"
codec => json
}

```

this is my "template.json" file that i want to load...must i add other in the first lines or is correct in this way?

![Screenshot (23)](https://us1.discourse-cdn.com/elastic/original/3X/8/f/8f1fa9ffdad510183f5b40b38a316075b8930fd3.png)

where I'm wronging?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 6, 2017, 6:16am UTC](https://discuss.elastic.co/t/how-load-template-with-logstash-using-elasticsearch-output-plugin/106325/2 "2017-11-06T06:16:32Z")

</div>

That's not what an index template looks like. I'm pretty sure your Logstash log contains messages indicating that Elasticsearch is rejecting the template. See the examples at [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:** ![citanionarrei](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@citanionarrei](https://discuss.elastic.co/u/citanionarrei)\
**Post date:** [November 6, 2017, 7:49am UTC](https://discuss.elastic.co/t/how-load-template-with-logstash-using-elasticsearch-output-plugin/106325/3 "2017-11-06T07:49:11Z")

</div>

Hi  
Maybe i have resolved with this

 ![IMG_20171105_165809](https://us1.discourse-cdn.com/elastic/original/3X/3/e/3ed3e9a93b34be62b8965947d324f42d59bc25fe.jpg)

What do you think?  
Now it is working

---

<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 4, 2017, 7:49am UTC](https://discuss.elastic.co/t/how-load-template-with-logstash-using-elasticsearch-output-plugin/106325/4 "2017-12-04T07:49:25Z")

</div>

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