# Cannot get my template to work

**URL:** <https://discuss.elastic.co/t/cannot-get-my-template-to-work/27150>\
**Category:** Logstash\
**Created:** [August 10, 2015, 7:08pm UTC](https://discuss.elastic.co/t/cannot-get-my-template-to-work/27150 "2015-08-10T19:08:47Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![FrankC](https://avatars.discourse-cdn.com/v4/letter/f/ed655f/32.png) [@FrankC](https://discuss.elastic.co/u/FrankC)\
**Post date:** [August 11, 2015, 2:23pm UTC](https://discuss.elastic.co/t/cannot-get-my-template-to-work/27150/15 "2015-08-11T14:23:34Z")

</div>

Hi Aaron,

Persistence pays off or maybe just that I took a break. Anyways... I got it to work 🙂

I boiled the template down to the bare essentials. It appears when I added the "order": 1 to the template it picks up the data types definition b/c it is a higher priority over the default logstash one.

As for the 400 error it must have been something logstash/ES does not like. I have seen quite a few others write about the same. Wish the error message could provide clues where to look.

Here is the template that worked:  
{  
"template" : "maptest",  
"order": 1,  
"mappings" : {  
"_default_" : {  
"\_all" : {"enabled" : false},  
"properties" : {  
"pk\_col": { "type": "string", "index": "not\_analyzed","doc\_values" : true },  
"dt\_type": { "type": "date", "index": "not\_analyzed", "format": "yyyy-MM-dd HH:mm:ss.SSS", "doc\_values" : true},  
"int\_type": { "type": "integer","doc\_values" : true },  
"float\_type": { "type": "float","doc\_values" : true },  
"str\_type\_analyzed": { "type": "string", "index": "analyzed" },  
"str\_type\_not\_analyzed": { "type": "string", "index": "not\_analyzed" ,"doc\_values" : true }  
}  
}  
}  
}

The config file:

elasticsearch  
{  
template\_overwrite =\> true  
template\_name =\> "maptest"  
manage\_template =\> true  
template =\> "c:/elasticsearch-1.6.0/config/templates/maptest/maptest.json"  
host =\> "localhost"  
index =\> "maptest"  
workers =\> 1  
}

---

_[View the full topic](https://discuss.elastic.co/t/cannot-get-my-template-to-work/27150)._
