# New template creation for shard value setup on elasticsearch

**URL:** https://discuss.elastic.co/t/new-template-creation-for-shard-value-setup-on-elasticsearch/153611
**Category:** Elasticsearch
**Created:** [October 23, 2018, 1:31pm UTC](https://discuss.elastic.co/t/new-template-creation-for-shard-value-setup-on-elasticsearch/153611 "2018-10-23T13:31:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)
#### Post date: [October 23, 2018, 1:31pm UTC](https://discuss.elastic.co/t/new-template-creation-for-shard-value-setup-on-elasticsearch/153611/1 "2018-10-23T13:31:11Z")

</div>

HI,  
I'm trying to create own template to set shard value for my index, when i run shell script which contain template creation command i'm getting below error any one could help me on this,

`{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}`

template.sh

```
curl -XPUT localhost:9200/_template/template_flyingarrow -d "
{
  "template": "*",
  "settings": {
    "number_of_shards": 2
  },
  "mappings": {
    "_doc": {
      "_source": {
        "enabled": false
      },
    }
  }
}"
```

---

<div class="post-metadata">

### Author: ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)
#### Post date: [October 23, 2018, 1:38pm UTC](https://discuss.elastic.co/t/new-template-creation-for-shard-value-setup-on-elasticsearch/153611/2 "2018-10-23T13:38:29Z")

</div>

Hi,

I remember I had a problem with the lastest versions and Curl, adding this header solved the problem :

```
-H 'Content-Type: application/json' 

```

bye,  
Xavier

---

<div class="post-metadata">

### Author: ![Ganesh2303](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Ganesh2303](https://discuss.elastic.co/u/Ganesh2303)
#### Post date: [October 23, 2018, 2:20pm UTC](https://discuss.elastic.co/t/new-template-creation-for-shard-value-setup-on-elasticsearch/153611/4 "2018-10-23T14:20:33Z")

</div>

Issue resolved thank you so much

```
curl -H 'Content-Type: application/json' -XPUT 'localhost:9200/_template/template_flyingarrow' -d "
{
  \"index_patterns\": \"*\",
  \"settings\": {
   \"number_of_shards\": 2
  }
}"
```

---

<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: [November 20, 2018, 2:21pm UTC](https://discuss.elastic.co/t/new-template-creation-for-shard-value-setup-on-elasticsearch/153611/5 "2018-11-20T14:21:18Z")

</div>

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