# Custom index template is not working

**URL:** https://discuss.elastic.co/t/custom-index-template-is-not-working/166998
**Category:** Elasticsearch
**Created:** [February 4, 2019, 4:55pm UTC](https://discuss.elastic.co/t/custom-index-template-is-not-working/166998 "2019-02-04T16:55:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Hetal\_Parmar](https://avatars.discourse-cdn.com/v4/letter/h/f08c70/32.png) [@Hetal\_Parmar](https://discuss.elastic.co/u/Hetal_Parmar)
#### Post date: [February 4, 2019, 4:55pm UTC](https://discuss.elastic.co/t/custom-index-template-is-not-working/166998/1 "2019-02-04T16:55:44Z")

</div>

I m trying to make custom index mapping template and use it with logstash

logstash config file output section  
output{  
elasticsearch {  
hosts =\> "localhost:9200"  
index =\> "employee\_index"  
document\_id =\>"%{empid}"  
manage\_template =\> false  
template =\> "E:/abc/myfolder/data/testmapping.json"  
template\_name =\> "employee\_index\_1"  
template\_overwrite =\> true  
}

following is testmapping.json file

```
{
  "template": "employee_index_1",
  "order": 1,
    "index_patterns": [
    "emp*" ],
  "mappings": {
    "_doc": {
      "_source": {
        "enabled": false
      },
      "properties": {
        "empid": {
          "type": "integer"
        },
        "empname": {
          "type": "text"
      
        },
		 "deptid": {
          "type": "integer"
      
        },
		 "revid": {
          "type": "integer"
      
        },
		"revenue":{
		"type":"nested",
			"properties": {
				"2013": {
					"type": "long"
      
						},
				"2014": {
					"type": "long"
      
						}
			}
		}
		
		
		
      }
    }
  }
}

```

now i m getting following output  
{  
"\_index" : "employee\_index",  
"\_type" : "doc",  
"\_id" : "4585",  
"\_score" : 1.0,  
"\_source" : {  
"deptid" : 2222,  
"revid" : 1256,  
"empid" : 4585,  
"rev2013" : "119.3",  
"@version" : "1",  
"empname" : "hetal k",  
"@timestamp" : "2019-02-04T16:48:56.961Z",  
"rev2014" : "830.3"  
}  
},

in mappings i mentioned nested field for revenue which is not coming in output

elasticsearch logs  
[employee\_index] creating index, cause [auto(bulk api)], templates , shards [5]/[1], mappings   
[employee\_index/OLr\_2LyAQ4eMMuTLFQAwYA] create\_mapping [doc]

GET \_template/employee\_index\_1  
is showing {}  
so i guess the index template has not been created  
Please help to sort out this issue.  
Thanks

---

<div class="post-metadata">

### Author: ![Hetal\_Parmar](https://avatars.discourse-cdn.com/v4/letter/h/f08c70/32.png) [@Hetal\_Parmar](https://discuss.elastic.co/u/Hetal_Parmar)
#### Post date: [February 6, 2019, 4:15pm UTC](https://discuss.elastic.co/t/custom-index-template-is-not-working/166998/2 "2019-02-06T16:15:01Z")

</div>

if someone face same problem pls share your workaround .  
thanks

---

<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: [March 6, 2019, 4:15pm UTC](https://discuss.elastic.co/t/custom-index-template-is-not-working/166998/3 "2019-03-06T16:15:04Z")

</div>

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