# Trying to create a new template

**URL:** <https://discuss.elastic.co/t/trying-to-create-a-new-template/183921>\
**Category:** Elasticsearch\
**Created:** [June 3, 2019, 9:31am UTC](https://discuss.elastic.co/t/trying-to-create-a-new-template/183921 "2019-06-03T09:31:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GedeoN](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@GedeoN](https://discuss.elastic.co/u/GedeoN)\
**Post date:** [June 3, 2019, 9:31am UTC](https://discuss.elastic.co/t/trying-to-create-a-new-template/183921/1 "2019-06-03T09:31:38Z")

</div>

Hi guys,

I'm trying to create a new template. This template is a "default", and all indices must be create with this template.  
I use Dev Tools on Kibana to create it.

`
PUT _template/template_default
{
  "template" : "template_default",
  "template_default": {
    "order": 0,
    "template": "*",
    "settings": {
      "index": {
        "number_of_shards": "2",
        "number_of_replicas": "1"
      }
    }
  }
}
`

It returns  
{  
"acknowledged": true  
}

So i think it's actually good, but when i list my template, i have this return:

{  
"template\_default": {  
"order": 0,  
"template": "template\_default",  
"settings": {},  
"mappings": {},  
"aliases": {}  
}  
}

In fact, i can't change fields.  
I don't know why.

If you had any idea...  
Regards.

---

<div class="post-metadata">

**Author:** ![martinr\_ubi](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@martinr\_ubi](https://discuss.elastic.co/u/martinr_ubi)\
**Post date:** [June 3, 2019, 10:01am UTC](https://discuss.elastic.co/t/trying-to-create-a-new-template/183921/2 "2019-06-03T10:01:53Z")

</div>

Hi,

I have to assume your using ES\<6.

Your json schema for an index template is wrong. For example in 5.6 its documented here [https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-templates.html)

In addition to bad hierarchy/schema for an index template, you're quoting integers in there, you should also fix that.

---

<div class="post-metadata">

**Author:** ![GedeoN](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@GedeoN](https://discuss.elastic.co/u/GedeoN)\
**Post date:** [June 3, 2019, 10:29am UTC](https://discuss.elastic.co/t/trying-to-create-a-new-template/183921/3 "2019-06-03T10:29:31Z")

</div>

Thx a lot for your answer.  
I think it's actually ok for this correction, when i try a GET, i've a return with my conf:  
GET \_template/default

{  
"default": {  
"order": 0,  
"template": "\*",  
"settings": {  
"index": {  
"number\_of\_shards": "2",  
"number\_of\_replicas": "1"  
}  
},  
"mappings": {},  
"aliases": {}  
}  
}

Can i see if my template actually works on all cluster?

---

<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 1, 2019, 10:29am UTC](https://discuss.elastic.co/t/trying-to-create-a-new-template/183921/4 "2019-07-01T10:29:37Z")

</div>

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