# Issue With Index templates

**URL:** <https://discuss.elastic.co/t/issue-with-index-templates/116171>\
**Category:** Logstash\
**Created:** [January 19, 2018, 6:18am UTC](https://discuss.elastic.co/t/issue-with-index-templates/116171 "2018-01-19T06:18:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![SJN8](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@SJN8](https://discuss.elastic.co/u/SJN8)\
**Post date:** [January 19, 2018, 6:18am UTC](https://discuss.elastic.co/t/issue-with-index-templates/116171/1 "2018-01-19T06:18:54Z")

</div>

Hi All,

I have a working pipeline with static ES Index as output .

But when i am trying to create index dynamically with index template , then indexes are not created .  
Below are my configuration ,

output {  
stdout { codec =\> rubydebug }  
elasticsearch {  
hosts =\> ["node1:9200","node2:9200", "node3:9200"]  
index =\> "dynaminc\_index-%{dd.MM.YYYY}"  
manage\_template =\> true  
template\_overwrite =\> true  
template =\> "/etc/logstash/templates/dynamic.json"  
template\_name =\> "dynamic"  
user =\> "logstash\_internal"  
password =\> "LS-INTERNAL"  
}

```
   }

```

below are the content of template

{  
"template": "dynamic",  
"settings": {  
"index": {  
"number\_of\_shards": "5",  
"number\_of\_replicas": "2",  
"refresh\_interval": "5s"

```
            }
    }

```

}

Please let me know what i am missing here .  
It is bit critical issue so urgent suggestions would be appreciated .

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 19, 2018, 8:47am UTC](https://discuss.elastic.co/t/issue-with-index-templates/116171/2 "2018-01-19T08:47:06Z")

</div>

> [@SJN8](#):
>
> "template": "dynamic",

This template will only apply to an index named `dynamic`. To make it apply to your index, change this to an appropriate pattern, e.g. `dynamic_index*`.

---

<div class="post-metadata">

**Author:** ![SJN8](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@SJN8](https://discuss.elastic.co/u/SJN8)\
**Post date:** [January 19, 2018, 8:49am UTC](https://discuss.elastic.co/t/issue-with-index-templates/116171/3 "2018-01-19T08:49:36Z")

</div>

Sorry , i didnt get you ,

where i have to make changes ,

In template file i.e. dynamic.json ??

or anywhere else ?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 19, 2018, 8:51am UTC](https://discuss.elastic.co/t/issue-with-index-templates/116171/4 "2018-01-19T08:51:05Z")

</div>

You have to make the change in the index template. You can find an example of how to use patterns [in the documentation](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-templates.html).

---

<div class="post-metadata">

**Author:** ![SJN8](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@SJN8](https://discuss.elastic.co/u/SJN8)\
**Post date:** [January 19, 2018, 11:09am UTC](https://discuss.elastic.co/t/issue-with-index-templates/116171/5 "2018-01-19T11:09:08Z")

</div>

dynamic.json  
{  
"template": "dynamic-_",  
"index\_patterns": ["dynamic-_"],  
"settings": {  
"index": {  
"number\_of\_shards": "5",  
"number\_of\_replicas": "2",  
"refresh\_interval": "5s"

```
            }
    }

```

}

index =\> "dynamic-%{+dd.MM.YYYY}"  
manage\_template =\> true  
#template\_overwrite =\> true  
template =\> "/etc/logstash/templates/dynamic.json"  
template\_name =\> "dynamic-\*"  
user =\> "logstash\_internal"  
password =\> "LS-INTERNAL"

changes done but same issue , have tried all combination .  
am not getting what i am missing here .

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 19, 2018, 11:20am UTC](https://discuss.elastic.co/t/issue-with-index-templates/116171/6 "2018-01-19T11:20:28Z")

</div>

> [@SJN8](#):
>
> "template": "dynamic-",
> 
> "index\_patterns": ["dynamic-"],

Looks like you are missing a wildcard (`*`) at the end.

---

<div class="post-metadata">

**Author:** ![SJN8](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@SJN8](https://discuss.elastic.co/u/SJN8)\
**Post date:** [January 19, 2018, 11:48am UTC](https://discuss.elastic.co/t/issue-with-index-templates/116171/7 "2018-01-19T11:48:17Z")

</div>

nope it is there i have formatted the text so itz not apprearing

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [January 19, 2018, 11:53am UTC](https://discuss.elastic.co/t/issue-with-index-templates/116171/8 "2018-01-19T11:53:38Z")

</div>

What does the template stored in Elasticsearch look like?

> [@SJN8](#):
>
> #template\_overwrite =\> true

You may need to enable this for the template to be replaced. The changed template will then apply only when new indices are created.

---

<div class="post-metadata">

**Author:** ![SJN8](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@SJN8](https://discuss.elastic.co/u/SJN8)\
**Post date:** [January 19, 2018, 12:32pm UTC](https://discuss.elastic.co/t/issue-with-index-templates/116171/9 "2018-01-19T12:32:18Z")

</div>

Same with enabling  
template\_overwrite =\> true ,

do i need to mention template management details in logstash.yml as well ,  
manage\_template =\> true  
template\_overwrite =\> true

{  
"dynamic-_": {  
"order": 0,  
"index\_patterns": [  
"dynamic-_"  
],  
"settings": {  
"index": {  
"number\_of\_shards": "5",  
"number\_of\_replicas": "2",  
"refresh\_interval": "5s"  
}  
},  
"mappings": {},  
"aliases": {}  
}  
}

---

<div class="post-metadata">

**Author:** ![SJN8](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@SJN8](https://discuss.elastic.co/u/SJN8)\
**Post date:** [January 31, 2018, 9:52am UTC](https://discuss.elastic.co/t/issue-with-index-templates/116171/10 "2018-01-31T09:52:16Z")

</div>

Can anyone help on this ??

---

<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:** [February 28, 2018, 9:52am UTC](https://discuss.elastic.co/t/issue-with-index-templates/116171/11 "2018-02-28T09:52:21Z")

</div>

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