# Index Templates

**URL:** <https://discuss.elastic.co/t/index-templates/21639>\
**Category:** Elasticsearch\
**Created:** [January 14, 2015, 2:58pm UTC](https://discuss.elastic.co/t/index-templates/21639 "2015-01-14T14:58:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Howard](https://avatars.discourse-cdn.com/v4/letter/e/e95f7d/32.png) [@Eric\_Howard](https://discuss.elastic.co/u/Eric_Howard)\
**Post date:** [January 14, 2015, 2:58pm UTC](https://discuss.elastic.co/t/index-templates/21639/1 "2015-01-14T14:58:30Z")

</div>

At www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html it states that "Index templates can also be placed within the config location (path.conf) under the templates directory (note, make sure to place them on all master eligible nodes). For example, a file called template\_1.json can be placed under config/templates..."

I do not see a config/templates directory. Do i need to create it somewhere? I'm using elasticsearch 1.0.1-1.

Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/01f58b9f-df80-4908-b3c1-6fc349bc72ed%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/01f58b9f-df80-4908-b3c1-6fc349bc72ed%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 14, 2015, 2:59pm UTC](https://discuss.elastic.co/t/index-templates/21639/2 "2015-01-14T14:59:39Z")

</div>

Yes. This dir does not exist. You need to create it yourself.  
It should be readable by the user who run elasticsearch.

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)

> Le 14 janv. 2015 à 15:58, Eric Howard [dangerguy@gmail.com](mailto:dangerguy@gmail.com) a écrit :
> 
> At [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html) it states that "Index templates can also be placed within the config location (path.conf) under the templates directory (note, make sure to place them on all master eligible nodes). For example, a file called template\_1.json can be placed under config/templates..."
> 
> I do not see a config/templates directory. Do i need to create it somewhere? I'm using elasticsearch 1.0.1-1.
> 
> Thanks
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/01f58b9f-df80-4908-b3c1-6fc349bc72ed%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/01f58b9f-df80-4908-b3c1-6fc349bc72ed%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/EEB678EE-3A9B-4238-B608-2015A42E2895%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/EEB678EE-3A9B-4238-B608-2015A42E2895%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [January 14, 2015, 4:39pm UTC](https://discuss.elastic.co/t/index-templates/21639/3 "2015-01-14T16:39:27Z")

</div>

While it is possible to have a templates directory, it is not advisable to  
use it in a production environment. You would have to keep the contents of  
that directory synchronized between all of your nodes, otherwise you run  
the risk of inconsistencies.  
It is recommended, instead, to use the API to upload templates and update  
them that way, as needed.

--Aaron

On Wednesday, January 14, 2015 at 7:58:30 AM UTC-7, Eric Howard wrote:

> At  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html)  
> it states that "Index templates can also be placed within the config  
> location (path.conf) under the templates directory (note, make sure to  
> place them on all master eligible nodes). For example, a file called  
> template\_1.json can be placed under config/templates..."
> 
> I do not see a config/templates directory. Do i need to create it  
> somewhere? I'm using elasticsearch 1.0.1-1.
> 
> Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/778e6bb6-c0a8-492c-bf6f-0ecd0132224e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/778e6bb6-c0a8-492c-bf6f-0ecd0132224e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Eric\_Howard](https://avatars.discourse-cdn.com/v4/letter/e/e95f7d/32.png) [@Eric\_Howard](https://discuss.elastic.co/u/Eric_Howard)\
**Post date:** [January 14, 2015, 6:08pm UTC](https://discuss.elastic.co/t/index-templates/21639/4 "2015-01-14T18:08:36Z")

</div>

I added the template file to each node and restarted elasticsearch on each node but do not see the template when i issue "curl -XGET localhost:9200/\_template/?pretty".

If i use the API, are the changes persistent over reboots?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3526c5f7-62db-4b29-a2ea-4e32d32e8d1d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3526c5f7-62db-4b29-a2ea-4e32d32e8d1d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 14, 2015, 6:46pm UTC](https://discuss.elastic.co/t/index-templates/21639/5 "2015-01-14T18:46:56Z")

</div>

Yes.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 14 janv. 2015 à 19:08, Eric Howard [dangerguy@gmail.com](mailto:dangerguy@gmail.com) a écrit :
> 
> I added the template file to each node and restarted elasticsearch on each node but do not see the template when i issue "curl -XGET localhost:9200/\_template/?pretty".
> 
> If i use the API, are the changes persistent over reboots?
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3526c5f7-62db-4b29-a2ea-4e32d32e8d1d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3526c5f7-62db-4b29-a2ea-4e32d32e8d1d%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9CBB8F9D-0A94-44E9-AE17-AEAC35B61FBD%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/9CBB8F9D-0A94-44E9-AE17-AEAC35B61FBD%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [January 14, 2015, 6:53pm UTC](https://discuss.elastic.co/t/index-templates/21639/6 "2015-01-14T18:53:25Z")

</div>

Yes, they are persistent.

—Aaron

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1421261604862.e6b315ca%40Nodemailer](https://groups.google.com/d/msgid/elasticsearch/1421261604862.e6b315ca%40Nodemailer).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:38am UTC](https://discuss.elastic.co/t/index-templates/21639/7 "2017-07-06T00:38:55Z")

</div>


