# Custom template is getting ignored by latest LS2.0

**URL:** https://discuss.elastic.co/t/custom-template-is-getting-ignored-by-latest-ls2-0/35363
**Category:** Logstash
**Created:** [November 23, 2015, 9:15pm UTC](https://discuss.elastic.co/t/custom-template-is-getting-ignored-by-latest-ls2-0/35363 "2015-11-23T21:15:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)
#### Post date: [November 23, 2015, 9:15pm UTC](https://discuss.elastic.co/t/custom-template-is-getting-ignored-by-latest-ls2-0/35363/1 "2015-11-23T21:15:14Z")

</div>

Hi Experts ,

I am trying to implement my custom mapping which is in "elasticsearch-2.0.0\config\templates" folder. Actually I copied my old template from LS1.5.4. It was working absolutely fine in the older version of LS.

Now as suggested by the latest LS documents [(https://www.elastic.co/guide/en/logstash/current/\_upgrading\_logstash\_and\_elasticsearch\_to\_2\_0.html](https://www.elastic.co/guide/en/logstash/current/_upgrading_logstash_and_elasticsearch_to_2_0.html)) I am using following in the output plugin , but it is still ignoring my custom mapping.

```
output {   
if [type] == "LOG" {
elasticsearch { 
action => "index" 
template_overwrite => true
hosts => ["localhost:9200"]
index => "corr" 
workers => 2  
			}   
		}
}

```

Please suggest what I am doing wrong ?

---

<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: [November 23, 2015, 10:26pm UTC](https://discuss.elastic.co/t/custom-template-is-getting-ignored-by-latest-ls2-0/35363/2 "2015-11-23T22:26:58Z")

</div>

Elasticsearch 2.0 no longer allows you to use file-based templates. You must use the [\_template API](https://www.elastic.co/guide/en/elasticsearch/reference/2.0/indices-templates.html) to insert templates. (If you look at the 1.6 documentation, you'll see that the bottom-most block of text still allows for this config-file type template).

Fortunately, Logstash can do this for you. Just move that custom mapping file (must be complete JSON) to somewhere your Logstash user can read from, and add

```
template => "/path/to/mapping_template.json"

```

to your elasticsearch output block.

---

<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:21am UTC](https://discuss.elastic.co/t/custom-template-is-getting-ignored-by-latest-ls2-0/35363/3 "2017-07-06T05:21:39Z")

</div>


