# Changing index template, advice on layout

**URL:** <https://discuss.elastic.co/t/changing-index-template-advice-on-layout/66255>\
**Category:** Elasticsearch\
**Created:** [November 16, 2016, 2:00pm UTC](https://discuss.elastic.co/t/changing-index-template-advice-on-layout/66255 "2016-11-16T14:00:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregoryo](https://avatars.discourse-cdn.com/v4/letter/g/34f0e0/32.png) [@gregoryo](https://discuss.elastic.co/u/gregoryo)\
**Post date:** [November 16, 2016, 2:00pm UTC](https://discuss.elastic.co/t/changing-index-template-advice-on-layout/66255/1 "2016-11-16T14:00:44Z")

</div>

I'm upgrading ES 2.3 -\> 5.x, and using the upgrade [migration helper](https://github.com/elastic/elasticsearch-migration/tree/2.x). It essentially tells me to [move two settings](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking_50_settings_changes.html#_index_level_settings) out of elasticsearch.yml into [index templates](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-templates.html):

- index.merge.scheduler.max\_thread\_count
- index.number\_of\_shards

Here's how I've started: Get the existing template, 'de-nest' it by one level:

```
$ curl 'localhost:9200/_template/logstash?pretty' > logstash.template.json
$ sed -i '' -e '$d' -e '2d' logstash.template.json

```

Here's where I'm stuck. I want to add in the configuration values from above, but I'm not sure where in that file to put them. Do I follow the dot pattern with curly brackets? e.g. Is it it in settings -\> merge -\> scheduler -\> max\_thread\_count ?

If I don't get any advice I guess I'll hack around with some testing.

Later on, I plan to overwrite the existing template. I've tried this with a test template and it seems to work.

```
$ curl -XPUT 'http://localhost:9200/_template/logstash?pretty' -d @logstash.template.json

```

TIA,  
Greg.

---

<div class="post-metadata">

**Author:** ![gregoryo](https://avatars.discourse-cdn.com/v4/letter/g/34f0e0/32.png) [@gregoryo](https://discuss.elastic.co/u/gregoryo)\
**Post date:** [November 22, 2016, 6:26am UTC](https://discuss.elastic.co/t/changing-index-template-advice-on-layout/66255/2 "2016-11-22T06:26:34Z")

</div>

No answer, so I hacked about. It seemed to work to follow the dot pattern with curly bracket nesting:

```
$ head -11 logstash.template.json 
{
    "order" : 0,
    "template" : "logstash-*",
    "settings" : {
      "index" : {
        "merge" : {
          "scheduler" : {
            "max_thread_count" : "1"
          }
        },
        "number_of_shards" : "2",

```

I've removed the entries from elasticsearch.yml, restarted ES, and new indices get the right number of shards, and hopefully that means I've got the max\_thread\_count right.

---

<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:** [December 20, 2016, 6:26am UTC](https://discuss.elastic.co/t/changing-index-template-advice-on-layout/66255/3 "2016-12-20T06:26:36Z")

</div>

Closed on December 20, 2016, 6:26am UTC

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