# Loading of index settings template from file in config/templates

**URL:** <https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582>\
**Category:** Elasticsearch\
**Created:** [November 6, 2012, 3:39pm UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582 "2012-11-06T15:39:13Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Serg\_Pilipenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/serg_pilipenko/32/13833_2.png) [@Serg\_Pilipenko](https://discuss.elastic.co/u/Serg_Pilipenko)\
**Post date:** [November 6, 2012, 3:39pm UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/1 "2012-11-06T15:39:13Z")

</div>

Hi! Have anybody tried to load index settings template from file in  
config/templates like described here  
[http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)? I'm  
using v19.10 and it works for me only through http API e.g. url -XPUT  
localhost:9200/\_template/template\_1 but not through file.

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [November 7, 2012, 12:04am UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/2 "2012-11-07T00:04:31Z")

</div>

It seems to be working fine for me.

~/Software› curl -L -O  
[https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz](https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz)  
% Total % Received % Xferd Average Speed Time Time Time  
Current  
Dload Upload Total Spent Left  
Speed  
100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--  
2148k  
~/Software› tar -xzf elasticsearch-0.19.10.tar.gz  
~/Software› cd elasticsearch-0.19.10  
~/Software/elasticsearch-0.19.10› cd config  
~/Software/elasticsearch-0.19.10/config› mkdir templates  
~/Software/elasticsearch-0.19.10/config› cd templates  
~/Software/elasticsearch-0.19.10/config/templates› curl -L -O  
[https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json](https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json)  
% Total % Received % Xferd Average Speed Time Time Time  
Current  
Dload Upload Total Spent Left  
Speed  
103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--  
6900  
~/Software/elasticsearch-0.19.10/config/templates› cat template1.json  
{  
"template\_1" : {  
"template" : "\*",  
"settings" : {  
"index.number\_of\_shards" : 2  
},  
"mappings" : {  
"_default_" : {  
"\_source" : {  
"enabled" : false  
}  
},  
"type1" : {  
"\_all" : {  
"enabled" : false  
}  
}  
}  
}  
}  
~/Software/elasticsearch-0.19.10/config/templates› cd ../..  
~/Software/elasticsearch-0.19.10› bin/elasticsearch  
~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new\_index &&  
echo  
{"ok":true,"acknowledged":true}  
~/Software/elasticsearch-0.19.10› curl -XGET  
"localhost:9200/new\_index/\_settings?pretty=true" && echo  
{  
"new\_index" : {  
"settings" : {  
"index.number\_of\_shards" : "2",  
"index.number\_of\_replicas" : "1",  
"index.version.created" : "191099"  
}  
}  
}  
~/Software/elasticsearch-0.19.10› curl -XGET  
"localhost:9200/new\_index/\_mapping?pretty=true" && echo  
{  
"new\_index" : {  
"type1" : {  
"\_all" : {  
"enabled" : false  
},  
"\_source" : {  
"enabled" : false  
},  
"properties" : { }  
},  
"_default_" : {  
"\_source" : {  
"enabled" : false  
},  
"properties" : { }  
}  
}  
}

Did you copy this file to all master-eligible nodes?

On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:

> Hi! Have anybody tried to load index settings template from file in  
> config/templates like described here  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)? I'm  
> using v19.10 and it works for me only through http API e.g. url -XPUT  
> localhost:9200/\_template/template\_1 but not through file.

--

---

<div class="post-metadata">

**Author:** ![Rogerio\_Pereira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rogerio_pereira/32/2635_2.png) [@Rogerio\_Pereira](https://discuss.elastic.co/u/Rogerio_Pereira)\
**Post date:** [November 7, 2012, 12:46am UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/3 "2012-11-07T00:46:31Z")

</div>

This template can also have analysis configuration?

On Tuesday, November 6, 2012 10:04:32 PM UTC-2, Igor Motov wrote:

> It seems to be working fine for me.
> 
> ~/Software› curl -L -O  
> [https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz](https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz)  
> % Total % Received % Xferd Average Speed Time Time Time  
> Current  
> Dload Upload Total Spent Left  
> Speed  
> 100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--  
> 2148k  
> ~/Software› tar -xzf elasticsearch-0.19.10.tar.gz  
> ~/Software› cd elasticsearch-0.19.10  
> ~/Software/elasticsearch-0.19.10› cd config  
> ~/Software/elasticsearch-0.19.10/config› mkdir templates  
> ~/Software/elasticsearch-0.19.10/config› cd templates  
> ~/Software/elasticsearch-0.19.10/config/templates› curl -L -O  
> [https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json](https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json)  
> % Total % Received % Xferd Average Speed Time Time Time  
> Current  
> Dload Upload Total Spent Left  
> Speed  
> 103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--  
> 6900  
> ~/Software/elasticsearch-0.19.10/config/templates› cat template1.json  
> {  
> "template\_1" : {  
> "template" : "\*",  
> "settings" : {  
> "index.number\_of\_shards" : 2  
> },  
> "mappings" : {  
> "_default_" : {  
> "\_source" : {  
> "enabled" : false  
> }  
> },  
> "type1" : {  
> "\_all" : {  
> "enabled" : false  
> }  
> }  
> }  
> }  
> }  
> ~/Software/elasticsearch-0.19.10/config/templates› cd ../..  
> ~/Software/elasticsearch-0.19.10› bin/elasticsearch  
> ~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new\_index &&  
> echo  
> {"ok":true,"acknowledged":true}  
> ~/Software/elasticsearch-0.19.10› curl -XGET  
> "localhost:9200/new\_index/\_settings?pretty=true" && echo  
> {  
> "new\_index" : {  
> "settings" : {  
> "index.number\_of\_shards" : "2",  
> "index.number\_of\_replicas" : "1",  
> "index.version.created" : "191099"  
> }  
> }  
> }  
> ~/Software/elasticsearch-0.19.10› curl -XGET  
> "localhost:9200/new\_index/\_mapping?pretty=true" && echo  
> {  
> "new\_index" : {  
> "type1" : {  
> "\_all" : {  
> "enabled" : false  
> },  
> "\_source" : {  
> "enabled" : false  
> },  
> "properties" : { }  
> },  
> "_default_" : {  
> "\_source" : {  
> "enabled" : false  
> },  
> "properties" : { }  
> }  
> }  
> }
> 
> Did you copy this file to all master-eligible nodes?
> 
> On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:
> 
> > Hi! Have anybody tried to load index settings template from file in  
> > config/templates like described here  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)? I'm  
> > using v19.10 and it works for me only through http API e.g. url -XPUT  
> > localhost:9200/\_template/template\_1 but not through file.

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [November 7, 2012, 1:26am UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/4 "2012-11-07T01:26:09Z")

</div>

Sure. Analysis configuration is just settings and mappings after all. You  
can also define custom analyzers in config/elasticsearch.yml and refer to  
them in template mappings.

On Tuesday, November 6, 2012 7:46:31 PM UTC-5, Rogerio Pereira wrote:

> This template can also have analysis configuration?
> 
> On Tuesday, November 6, 2012 10:04:32 PM UTC-2, Igor Motov wrote:
> 
> > It seems to be working fine for me.
> > 
> > ~/Software› curl -L -O  
> > [https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz](https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz)  
> > % Total % Received % Xferd Average Speed Time Time Time  
> > Current  
> > Dload Upload Total Spent Left  
> > Speed  
> > 100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--  
> > 2148k  
> > ~/Software› tar -xzf elasticsearch-0.19.10.tar.gz  
> > ~/Software› cd elasticsearch-0.19.10  
> > ~/Software/elasticsearch-0.19.10› cd config  
> > ~/Software/elasticsearch-0.19.10/config› mkdir templates  
> > ~/Software/elasticsearch-0.19.10/config› cd templates  
> > ~/Software/elasticsearch-0.19.10/config/templates› curl -L -O  
> > [https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json](https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json)  
> > % Total % Received % Xferd Average Speed Time Time Time  
> > Current  
> > Dload Upload Total Spent Left  
> > Speed  
> > 103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--  
> > 6900  
> > ~/Software/elasticsearch-0.19.10/config/templates› cat template1.json  
> > {  
> > "template\_1" : {  
> > "template" : "\*",  
> > "settings" : {  
> > "index.number\_of\_shards" : 2  
> > },  
> > "mappings" : {  
> > "_default_" : {  
> > "\_source" : {  
> > "enabled" : false  
> > }  
> > },  
> > "type1" : {  
> > "\_all" : {  
> > "enabled" : false  
> > }  
> > }  
> > }  
> > }  
> > }  
> > ~/Software/elasticsearch-0.19.10/config/templates› cd ../..  
> > ~/Software/elasticsearch-0.19.10› bin/elasticsearch  
> > ~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new\_index &&  
> > echo  
> > {"ok":true,"acknowledged":true}  
> > ~/Software/elasticsearch-0.19.10› curl -XGET  
> > "localhost:9200/new\_index/\_settings?pretty=true" && echo  
> > {  
> > "new\_index" : {  
> > "settings" : {  
> > "index.number\_of\_shards" : "2",  
> > "index.number\_of\_replicas" : "1",  
> > "index.version.created" : "191099"  
> > }  
> > }  
> > }  
> > ~/Software/elasticsearch-0.19.10› curl -XGET  
> > "localhost:9200/new\_index/\_mapping?pretty=true" && echo  
> > {  
> > "new\_index" : {  
> > "type1" : {  
> > "\_all" : {  
> > "enabled" : false  
> > },  
> > "\_source" : {  
> > "enabled" : false  
> > },  
> > "properties" : { }  
> > },  
> > "_default_" : {  
> > "\_source" : {  
> > "enabled" : false  
> > },  
> > "properties" : { }  
> > }  
> > }  
> > }
> > 
> > Did you copy this file to all master-eligible nodes?
> > 
> > On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:
> > 
> > > Hi! Have anybody tried to load index settings template from file in  
> > > config/templates like described here  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)? I'm  
> > > using v19.10 and it works for me only through http API e.g. url -XPUT  
> > > localhost:9200/\_template/template\_1 but not through file.

--

---

<div class="post-metadata">

**Author:** ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)\
**Post date:** [November 7, 2012, 6:47am UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/5 "2012-11-07T06:47:12Z")

</div>

Serg Pilipenko wrote:

> Have anybody tried to load index settings template from file in  
> config/templates like described here  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)?  
> I'm using v19.10 and it works for me only through http API e.g. url  
> -XPUT localhost:9200/\_template/template\_1 but not through file.

I verified that this works. How many nodes in your cluster? Perhaps  
you didn't put the file in the config/ of the current master (where  
index creation happens).

-Drew

---

<div class="post-metadata">

**Author:** ![Serg\_Pilipenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/serg_pilipenko/32/13833_2.png) [@Serg\_Pilipenko](https://discuss.elastic.co/u/Serg_Pilipenko)\
**Post date:** [November 7, 2012, 2:43pm UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/6 "2012-11-07T14:43:56Z")

</div>

You are right, it works for me to.

So I've found my mistake. When I've tried to use option -Des.config  
or -Des.path.config or -Des.config.path it stops searching templates  
in -Des.path.home and not able to find it in -Des.config  
or -Des.path.config or -Des.config.path. I've tried to specify different  
paths here but not success.

The right combination in this case is:  
-Des.path.home #application location  
-Des.path.config=/another/etc/elasticsearch/config  
-Des.config=/another/etc/elasticsearch/config/elasticsearch.json

dir -R etc/elasticsearch  
etc/elasticsearch:  
config logging.json

etc/elasticsearch/config:  
elasticsearch.json templates

etc/elasticsearch/config/templates:  
template\_1.json

This is really trivial but without clear doc I've stuck with guessing of  
this variables and paths.

среда, 7 ноября 2012 г., 1:04:32 UTC+1 пользователь Igor Motov написал:

> It seems to be working fine for me.
> 
> ~/Software› curl -L -O  
> [https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz](https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz)  
> % Total % Received % Xferd Average Speed Time Time Time  
> Current  
> Dload Upload Total Spent Left  
> Speed  
> 100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--  
> 2148k  
> ~/Software› tar -xzf elasticsearch-0.19.10.tar.gz  
> ~/Software› cd elasticsearch-0.19.10  
> ~/Software/elasticsearch-0.19.10› cd config  
> ~/Software/elasticsearch-0.19.10/config› mkdir templates  
> ~/Software/elasticsearch-0.19.10/config› cd templates  
> ~/Software/elasticsearch-0.19.10/config/templates› curl -L -O  
> [https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json](https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json)  
> % Total % Received % Xferd Average Speed Time Time Time  
> Current  
> Dload Upload Total Spent Left  
> Speed  
> 103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--  
> 6900  
> ~/Software/elasticsearch-0.19.10/config/templates› cat template1.json  
> {  
> "template\_1" : {  
> "template" : "\*",  
> "settings" : {  
> "index.number\_of\_shards" : 2  
> },  
> "mappings" : {  
> "_default_" : {  
> "\_source" : {  
> "enabled" : false  
> }  
> },  
> "type1" : {  
> "\_all" : {  
> "enabled" : false  
> }  
> }  
> }  
> }  
> }  
> ~/Software/elasticsearch-0.19.10/config/templates› cd ../..  
> ~/Software/elasticsearch-0.19.10› bin/elasticsearch  
> ~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new\_index &&  
> echo  
> {"ok":true,"acknowledged":true}  
> ~/Software/elasticsearch-0.19.10› curl -XGET  
> "localhost:9200/new\_index/\_settings?pretty=true" && echo  
> {  
> "new\_index" : {  
> "settings" : {  
> "index.number\_of\_shards" : "2",  
> "index.number\_of\_replicas" : "1",  
> "index.version.created" : "191099"  
> }  
> }  
> }  
> ~/Software/elasticsearch-0.19.10› curl -XGET  
> "localhost:9200/new\_index/\_mapping?pretty=true" && echo  
> {  
> "new\_index" : {  
> "type1" : {  
> "\_all" : {  
> "enabled" : false  
> },  
> "\_source" : {  
> "enabled" : false  
> },  
> "properties" : { }  
> },  
> "_default_" : {  
> "\_source" : {  
> "enabled" : false  
> },  
> "properties" : { }  
> }  
> }  
> }
> 
> Did you copy this file to all master-eligible nodes?
> 
> On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:
> 
> > Hi! Have anybody tried to load index settings template from file in  
> > config/templates like described here  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)? I'm  
> > using v19.10 and it works for me only through http API e.g. url -XPUT  
> > localhost:9200/\_template/template\_1 but not through file.

--

---

<div class="post-metadata">

**Author:** ![Serg\_Pilipenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/serg_pilipenko/32/13833_2.png) [@Serg\_Pilipenko](https://discuss.elastic.co/u/Serg_Pilipenko)\
**Post date:** [November 7, 2012, 4:44pm UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/7 "2012-11-07T16:44:59Z")

</div>

So I've made mistake again.  
ES don't recognize config/templates/\* in place another than -Des.path.home  
Or I'm doing something wrong.

среда, 7 ноября 2012 г., 15:43:56 UTC+1 пользователь Serg Pilipenko написал:

> You are right, it works for me to.
> 
> So I've found my mistake. When I've tried to use option -Des.config  
> or -Des.path.config or -Des.config.path it stops searching templates  
> in -Des.path.home and not able to find it in -Des.config  
> or -Des.path.config or -Des.config.path. I've tried to specify different  
> paths here but not success.
> 
> The right combination in this case is:  
> -Des.path.home #application location  
> -Des.path.config=/another/etc/elasticsearch/config  
> -Des.config=/another/etc/elasticsearch/config/elasticsearch.json
> 
> dir -R etc/elasticsearch  
> etc/elasticsearch:  
> config logging.json
> 
> etc/elasticsearch/config:  
> elasticsearch.json templates
> 
> etc/elasticsearch/config/templates:  
> template\_1.json
> 
> This is really trivial but without clear doc I've stuck with guessing of  
> this variables and paths.
> 
> среда, 7 ноября 2012 г., 1:04:32 UTC+1 пользователь Igor Motov написал:
> 
> > It seems to be working fine for me.
> > 
> > ~/Software› curl -L -O  
> > [https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz](https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz)  
> > % Total % Received % Xferd Average Speed Time Time Time  
> > Current  
> > Dload Upload Total Spent Left  
> > Speed  
> > 100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--  
> > 2148k  
> > ~/Software› tar -xzf elasticsearch-0.19.10.tar.gz  
> > ~/Software› cd elasticsearch-0.19.10  
> > ~/Software/elasticsearch-0.19.10› cd config  
> > ~/Software/elasticsearch-0.19.10/config› mkdir templates  
> > ~/Software/elasticsearch-0.19.10/config› cd templates  
> > ~/Software/elasticsearch-0.19.10/config/templates› curl -L -O  
> > [https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json](https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json)  
> > % Total % Received % Xferd Average Speed Time Time Time  
> > Current  
> > Dload Upload Total Spent Left  
> > Speed  
> > 103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--  
> > 6900  
> > ~/Software/elasticsearch-0.19.10/config/templates› cat template1.json  
> > {  
> > "template\_1" : {  
> > "template" : "\*",  
> > "settings" : {  
> > "index.number\_of\_shards" : 2  
> > },  
> > "mappings" : {  
> > "_default_" : {  
> > "\_source" : {  
> > "enabled" : false  
> > }  
> > },  
> > "type1" : {  
> > "\_all" : {  
> > "enabled" : false  
> > }  
> > }  
> > }  
> > }  
> > }  
> > ~/Software/elasticsearch-0.19.10/config/templates› cd ../..  
> > ~/Software/elasticsearch-0.19.10› bin/elasticsearch  
> > ~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new\_index &&  
> > echo  
> > {"ok":true,"acknowledged":true}  
> > ~/Software/elasticsearch-0.19.10› curl -XGET  
> > "localhost:9200/new\_index/\_settings?pretty=true" && echo  
> > {  
> > "new\_index" : {  
> > "settings" : {  
> > "index.number\_of\_shards" : "2",  
> > "index.number\_of\_replicas" : "1",  
> > "index.version.created" : "191099"  
> > }  
> > }  
> > }  
> > ~/Software/elasticsearch-0.19.10› curl -XGET  
> > "localhost:9200/new\_index/\_mapping?pretty=true" && echo  
> > {  
> > "new\_index" : {  
> > "type1" : {  
> > "\_all" : {  
> > "enabled" : false  
> > },  
> > "\_source" : {  
> > "enabled" : false  
> > },  
> > "properties" : { }  
> > },  
> > "_default_" : {  
> > "\_source" : {  
> > "enabled" : false  
> > },  
> > "properties" : { }  
> > }  
> > }  
> > }
> > 
> > Did you copy this file to all master-eligible nodes?
> > 
> > On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:
> > 
> > > Hi! Have anybody tried to load index settings template from file in  
> > > config/templates like described here  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)? I'm  
> > > using v19.10 and it works for me only through http API e.g. url -XPUT  
> > > localhost:9200/\_template/template\_1 but not through file.

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [November 7, 2012, 5:40pm UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/8 "2012-11-07T17:40:10Z")

</div>

It should be -Des.path.conf=...

On Wednesday, November 7, 2012 11:44:59 AM UTC-5, Serg Pilipenko wrote:

> So I've made mistake again.  
> ES don't recognize config/templates/\* in place another than -Des.path.home  
> Or I'm doing something wrong.
> 
> среда, 7 ноября 2012 г., 15:43:56 UTC+1 пользователь Serg Pilipenko  
> написал:
> 
> > You are right, it works for me to.
> > 
> > So I've found my mistake. When I've tried to use option -Des.config  
> > or -Des.path.config or -Des.config.path it stops searching templates  
> > in -Des.path.home and not able to find it in -Des.config  
> > or -Des.path.config or -Des.config.path. I've tried to specify different  
> > paths here but not success.
> > 
> > The right combination in this case is:  
> > -Des.path.home #application location  
> > -Des.path.config=/another/etc/elasticsearch/config  
> > -Des.config=/another/etc/elasticsearch/config/elasticsearch.json
> > 
> > dir -R etc/elasticsearch  
> > etc/elasticsearch:  
> > config logging.json
> > 
> > etc/elasticsearch/config:  
> > elasticsearch.json templates
> > 
> > etc/elasticsearch/config/templates:  
> > template\_1.json
> > 
> > This is really trivial but without clear doc I've stuck with guessing of  
> > this variables and paths.
> > 
> > среда, 7 ноября 2012 г., 1:04:32 UTC+1 пользователь Igor Motov написал:
> > 
> > > It seems to be working fine for me.
> > > 
> > > ~/Software› curl -L -O  
> > > [https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz](https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz)  
> > > % Total % Received % Xferd Average Speed Time Time Time  
> > > Current  
> > > Dload Upload Total Spent Left  
> > > Speed  
> > > 100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--  
> > > 2148k  
> > > ~/Software› tar -xzf elasticsearch-0.19.10.tar.gz  
> > > ~/Software› cd elasticsearch-0.19.10  
> > > ~/Software/elasticsearch-0.19.10› cd config  
> > > ~/Software/elasticsearch-0.19.10/config› mkdir templates  
> > > ~/Software/elasticsearch-0.19.10/config› cd templates  
> > > ~/Software/elasticsearch-0.19.10/config/templates› curl -L -O  
> > > [https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json](https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json)  
> > > % Total % Received % Xferd Average Speed Time Time Time  
> > > Current  
> > > Dload Upload Total Spent Left  
> > > Speed  
> > > 103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--  
> > > 6900  
> > > ~/Software/elasticsearch-0.19.10/config/templates› cat template1.json  
> > > {  
> > > "template\_1" : {  
> > > "template" : "\*",  
> > > "settings" : {  
> > > "index.number\_of\_shards" : 2  
> > > },  
> > > "mappings" : {  
> > > "_default_" : {  
> > > "\_source" : {  
> > > "enabled" : false  
> > > }  
> > > },  
> > > "type1" : {  
> > > "\_all" : {  
> > > "enabled" : false  
> > > }  
> > > }  
> > > }  
> > > }  
> > > }  
> > > ~/Software/elasticsearch-0.19.10/config/templates› cd ../..  
> > > ~/Software/elasticsearch-0.19.10› bin/elasticsearch  
> > > ~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new\_index &&  
> > > echo  
> > > {"ok":true,"acknowledged":true}  
> > > ~/Software/elasticsearch-0.19.10› curl -XGET  
> > > "localhost:9200/new\_index/\_settings?pretty=true" && echo  
> > > {  
> > > "new\_index" : {  
> > > "settings" : {  
> > > "index.number\_of\_shards" : "2",  
> > > "index.number\_of\_replicas" : "1",  
> > > "index.version.created" : "191099"  
> > > }  
> > > }  
> > > }  
> > > ~/Software/elasticsearch-0.19.10› curl -XGET  
> > > "localhost:9200/new\_index/\_mapping?pretty=true" && echo  
> > > {  
> > > "new\_index" : {  
> > > "type1" : {  
> > > "\_all" : {  
> > > "enabled" : false  
> > > },  
> > > "\_source" : {  
> > > "enabled" : false  
> > > },  
> > > "properties" : { }  
> > > },  
> > > "_default_" : {  
> > > "\_source" : {  
> > > "enabled" : false  
> > > },  
> > > "properties" : { }  
> > > }  
> > > }  
> > > }
> > > 
> > > Did you copy this file to all master-eligible nodes?
> > > 
> > > On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:
> > > 
> > > > Hi! Have anybody tried to load index settings template from file in  
> > > > config/templates like described here  
> > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)? I'm  
> > > > using v19.10 and it works for me only through http API e.g. url -XPUT  
> > > > localhost:9200/\_template/template\_1 but not through file.

--

---

<div class="post-metadata">

**Author:** ![Serg\_Pilipenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/serg_pilipenko/32/13833_2.png) [@Serg\_Pilipenko](https://discuss.elastic.co/u/Serg_Pilipenko)\
**Post date:** [November 7, 2012, 6:43pm UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/9 "2012-11-07T18:43:32Z")

</div>

Thanks! Now really works. It should be fixed in the doc here

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

"path.conf" but not "path.config"

среда, 7 ноября 2012 г., 18:40:10 UTC+1 пользователь Igor Motov написал:

> It should be -Des.path.conf=...
> 
> On Wednesday, November 7, 2012 11:44:59 AM UTC-5, Serg Pilipenko wrote:
> 
> > So I've made mistake again.  
> > ES don't recognize config/templates/\* in place another than -Des.path.home  
> > Or I'm doing something wrong.
> > 
> > среда, 7 ноября 2012 г., 15:43:56 UTC+1 пользователь Serg Pilipenko  
> > написал:
> > 
> > > You are right, it works for me to.
> > > 
> > > So I've found my mistake. When I've tried to use option -Des.config  
> > > or -Des.path.config or -Des.config.path it stops searching templates  
> > > in -Des.path.home and not able to find it in -Des.config  
> > > or -Des.path.config or -Des.config.path. I've tried to specify different  
> > > paths here but not success.
> > > 
> > > The right combination in this case is:  
> > > -Des.path.home #application location  
> > > -Des.path.config=/another/etc/elasticsearch/config  
> > > -Des.config=/another/etc/elasticsearch/config/elasticsearch.json
> > > 
> > > dir -R etc/elasticsearch  
> > > etc/elasticsearch:  
> > > config logging.json
> > > 
> > > etc/elasticsearch/config:  
> > > elasticsearch.json templates
> > > 
> > > etc/elasticsearch/config/templates:  
> > > template\_1.json
> > > 
> > > This is really trivial but without clear doc I've stuck with guessing of  
> > > this variables and paths.
> > > 
> > > среда, 7 ноября 2012 г., 1:04:32 UTC+1 пользователь Igor Motov написал:
> > > 
> > > > It seems to be working fine for me.
> > > > 
> > > > ~/Software› curl -L -O  
> > > > [https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz](https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz)  
> > > > % Total % Received % Xferd Average Speed Time Time Time  
> > > > Current  
> > > > Dload Upload Total Spent Left  
> > > > Speed  
> > > > 100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07  
> > > > --:--:-- 2148k  
> > > > ~/Software› tar -xzf elasticsearch-0.19.10.tar.gz  
> > > > ~/Software› cd elasticsearch-0.19.10  
> > > > ~/Software/elasticsearch-0.19.10› cd config  
> > > > ~/Software/elasticsearch-0.19.10/config› mkdir templates  
> > > > ~/Software/elasticsearch-0.19.10/config› cd templates  
> > > > ~/Software/elasticsearch-0.19.10/config/templates› curl -L -O  
> > > > [https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json](https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json)  
> > > > % Total % Received % Xferd Average Speed Time Time Time  
> > > > Current  
> > > > Dload Upload Total Spent Left  
> > > > Speed  
> > > > 103 414 103 414 0 0 707 0 --:--:-- --:--:--  
> > > > --:--:-- 6900  
> > > > ~/Software/elasticsearch-0.19.10/config/templates› cat template1.json  
> > > > {  
> > > > "template\_1" : {  
> > > > "template" : "\*",  
> > > > "settings" : {  
> > > > "index.number\_of\_shards" : 2  
> > > > },  
> > > > "mappings" : {  
> > > > "_default_" : {  
> > > > "\_source" : {  
> > > > "enabled" : false  
> > > > }  
> > > > },  
> > > > "type1" : {  
> > > > "\_all" : {  
> > > > "enabled" : false  
> > > > }  
> > > > }  
> > > > }  
> > > > }  
> > > > }  
> > > > ~/Software/elasticsearch-0.19.10/config/templates› cd ../..  
> > > > ~/Software/elasticsearch-0.19.10› bin/elasticsearch  
> > > > ~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new\_index  
> > > > && echo  
> > > > {"ok":true,"acknowledged":true}  
> > > > ~/Software/elasticsearch-0.19.10› curl -XGET  
> > > > "localhost:9200/new\_index/\_settings?pretty=true" && echo  
> > > > {  
> > > > "new\_index" : {  
> > > > "settings" : {  
> > > > "index.number\_of\_shards" : "2",  
> > > > "index.number\_of\_replicas" : "1",  
> > > > "index.version.created" : "191099"  
> > > > }  
> > > > }  
> > > > }  
> > > > ~/Software/elasticsearch-0.19.10› curl -XGET  
> > > > "localhost:9200/new\_index/\_mapping?pretty=true" && echo  
> > > > {  
> > > > "new\_index" : {  
> > > > "type1" : {  
> > > > "\_all" : {  
> > > > "enabled" : false  
> > > > },  
> > > > "\_source" : {  
> > > > "enabled" : false  
> > > > },  
> > > > "properties" : { }  
> > > > },  
> > > > "_default_" : {  
> > > > "\_source" : {  
> > > > "enabled" : false  
> > > > },  
> > > > "properties" : { }  
> > > > }  
> > > > }  
> > > > }
> > > > 
> > > > Did you copy this file to all master-eligible nodes?
> > > > 
> > > > On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:
> > > > 
> > > > > Hi! Have anybody tried to load index settings template from file in  
> > > > > config/templates like described here  
> > > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)? I'm  
> > > > > using v19.10 and it works for me only through http API e.g. url -XPUT  
> > > > > localhost:9200/\_template/template\_1 but not through file.

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [November 7, 2012, 7:48pm UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/10 "2012-11-07T19:48:25Z")

</div>

Fixed! Thanks for pointing it out. I didn't notice that it was  
"path.config" on this page.

On Wednesday, November 7, 2012 1:43:32 PM UTC-5, Serg Pilipenko wrote:

> Thanks! Now really works. It should be fixed in the doc here  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)
> 
> "path.conf" but not "path.config"
> 
> среда, 7 ноября 2012 г., 18:40:10 UTC+1 пользователь Igor Motov написал:
> 
> > It should be -Des.path.conf=...
> > 
> > On Wednesday, November 7, 2012 11:44:59 AM UTC-5, Serg Pilipenko wrote:
> > 
> > > So I've made mistake again.  
> > > ES don't recognize config/templates/\* in place another  
> > > than -Des.path.home  
> > > Or I'm doing something wrong.
> > > 
> > > среда, 7 ноября 2012 г., 15:43:56 UTC+1 пользователь Serg Pilipenko  
> > > написал:
> > > 
> > > > You are right, it works for me to.
> > > > 
> > > > So I've found my mistake. When I've tried to use option -Des.config  
> > > > or -Des.path.config or -Des.config.path it stops searching templates  
> > > > in -Des.path.home and not able to find it in -Des.config  
> > > > or -Des.path.config or -Des.config.path. I've tried to specify different  
> > > > paths here but not success.
> > > > 
> > > > The right combination in this case is:  
> > > > -Des.path.home #application location  
> > > > -Des.path.config=/another/etc/elasticsearch/config  
> > > > -Des.config=/another/etc/elasticsearch/config/elasticsearch.json
> > > > 
> > > > dir -R etc/elasticsearch  
> > > > etc/elasticsearch:  
> > > > config logging.json
> > > > 
> > > > etc/elasticsearch/config:  
> > > > elasticsearch.json templates
> > > > 
> > > > etc/elasticsearch/config/templates:  
> > > > template\_1.json
> > > > 
> > > > This is really trivial but without clear doc I've stuck with guessing  
> > > > of this variables and paths.
> > > > 
> > > > среда, 7 ноября 2012 г., 1:04:32 UTC+1 пользователь Igor Motov написал:
> > > > 
> > > > > It seems to be working fine for me.
> > > > > 
> > > > > ~/Software› curl -L -O  
> > > > > [https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz](https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz)  
> > > > > % Total % Received % Xferd Average Speed Time Time Time  
> > > > > Current  
> > > > > Dload Upload Total Spent Left  
> > > > > Speed  
> > > > > 100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07  
> > > > > --:--:-- 2148k  
> > > > > ~/Software› tar -xzf elasticsearch-0.19.10.tar.gz  
> > > > > ~/Software› cd elasticsearch-0.19.10  
> > > > > ~/Software/elasticsearch-0.19.10› cd config  
> > > > > ~/Software/elasticsearch-0.19.10/config› mkdir templates  
> > > > > ~/Software/elasticsearch-0.19.10/config› cd templates  
> > > > > ~/Software/elasticsearch-0.19.10/config/templates› curl -L -O  
> > > > > [https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json](https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json)  
> > > > > % Total % Received % Xferd Average Speed Time Time Time  
> > > > > Current  
> > > > > Dload Upload Total Spent Left  
> > > > > Speed  
> > > > > 103 414 103 414 0 0 707 0 --:--:-- --:--:--  
> > > > > --:--:-- 6900  
> > > > > ~/Software/elasticsearch-0.19.10/config/templates› cat template1.json  
> > > > > {  
> > > > > "template\_1" : {  
> > > > > "template" : "\*",  
> > > > > "settings" : {  
> > > > > "index.number\_of\_shards" : 2  
> > > > > },  
> > > > > "mappings" : {  
> > > > > "_default_" : {  
> > > > > "\_source" : {  
> > > > > "enabled" : false  
> > > > > }  
> > > > > },  
> > > > > "type1" : {  
> > > > > "\_all" : {  
> > > > > "enabled" : false  
> > > > > }  
> > > > > }  
> > > > > }  
> > > > > }  
> > > > > }  
> > > > > ~/Software/elasticsearch-0.19.10/config/templates› cd ../..  
> > > > > ~/Software/elasticsearch-0.19.10› bin/elasticsearch  
> > > > > ~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new\_index  
> > > > > && echo  
> > > > > {"ok":true,"acknowledged":true}  
> > > > > ~/Software/elasticsearch-0.19.10› curl -XGET  
> > > > > "localhost:9200/new\_index/\_settings?pretty=true" && echo  
> > > > > {  
> > > > > "new\_index" : {  
> > > > > "settings" : {  
> > > > > "index.number\_of\_shards" : "2",  
> > > > > "index.number\_of\_replicas" : "1",  
> > > > > "index.version.created" : "191099"  
> > > > > }  
> > > > > }  
> > > > > }  
> > > > > ~/Software/elasticsearch-0.19.10› curl -XGET  
> > > > > "localhost:9200/new\_index/\_mapping?pretty=true" && echo  
> > > > > {  
> > > > > "new\_index" : {  
> > > > > "type1" : {  
> > > > > "\_all" : {  
> > > > > "enabled" : false  
> > > > > },  
> > > > > "\_source" : {  
> > > > > "enabled" : false  
> > > > > },  
> > > > > "properties" : { }  
> > > > > },  
> > > > > "_default_" : {  
> > > > > "\_source" : {  
> > > > > "enabled" : false  
> > > > > },  
> > > > > "properties" : { }  
> > > > > }  
> > > > > }  
> > > > > }
> > > > > 
> > > > > Did you copy this file to all master-eligible nodes?
> > > > > 
> > > > > On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:
> > > > > 
> > > > > > Hi! Have anybody tried to load index settings template from file in  
> > > > > > config/templates like described here  
> > > > > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)? I'm  
> > > > > > using v19.10 and it works for me only through http API e.g. url -XPUT  
> > > > > > localhost:9200/\_template/template\_1 but not through file.

--

---

<div class="post-metadata">

**Author:** ![gondo\_2](https://avatars.discourse-cdn.com/v4/letter/g/f08c70/32.png) [@gondo\_2](https://discuss.elastic.co/u/gondo_2)\
**Post date:** [April 18, 2013, 12:24pm UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/11 "2013-04-18T12:24:30Z")

</div>

hi  
when i try your steps i would expect to be able to GET template info as  
well, however this command doesnt bring anything:  
curl -XGET "localhost:9200/\_template/template\_1" && echo

im trying to confirm that my template is loading successfully from config  
file, but i dont really know how  
thanks

On Wednesday, 7 November 2012 11:04:32 UTC+11, Igor Motov wrote:

> It seems to be working fine for me.
> 
> ~/Software› curl -L -O  
> [https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz](https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz)  
> % Total % Received % Xferd Average Speed Time Time Time  
> Current  
> Dload Upload Total Spent Left  
> Speed  
> 100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--  
> 2148k  
> ~/Software› tar -xzf elasticsearch-0.19.10.tar.gz  
> ~/Software› cd elasticsearch-0.19.10  
> ~/Software/elasticsearch-0.19.10› cd config  
> ~/Software/elasticsearch-0.19.10/config› mkdir templates  
> ~/Software/elasticsearch-0.19.10/config› cd templates  
> ~/Software/elasticsearch-0.19.10/config/templates› curl -L -O  
> [https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json](https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json)  
> % Total % Received % Xferd Average Speed Time Time Time  
> Current  
> Dload Upload Total Spent Left  
> Speed  
> 103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--  
> 6900  
> ~/Software/elasticsearch-0.19.10/config/templates› cat template1.json  
> {  
> "template\_1" : {  
> "template" : "\*",  
> "settings" : {  
> "index.number\_of\_shards" : 2  
> },  
> "mappings" : {  
> "_default_" : {  
> "\_source" : {  
> "enabled" : false  
> }  
> },  
> "type1" : {  
> "\_all" : {  
> "enabled" : false  
> }  
> }  
> }  
> }  
> }  
> ~/Software/elasticsearch-0.19.10/config/templates› cd ../..  
> ~/Software/elasticsearch-0.19.10› bin/elasticsearch  
> ~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new\_index &&  
> echo  
> {"ok":true,"acknowledged":true}  
> ~/Software/elasticsearch-0.19.10› curl -XGET  
> "localhost:9200/new\_index/\_settings?pretty=true" && echo  
> {  
> "new\_index" : {  
> "settings" : {  
> "index.number\_of\_shards" : "2",  
> "index.number\_of\_replicas" : "1",  
> "index.version.created" : "191099"  
> }  
> }  
> }  
> ~/Software/elasticsearch-0.19.10› curl -XGET  
> "localhost:9200/new\_index/\_mapping?pretty=true" && echo  
> {  
> "new\_index" : {  
> "type1" : {  
> "\_all" : {  
> "enabled" : false  
> },  
> "\_source" : {  
> "enabled" : false  
> },  
> "properties" : { }  
> },  
> "_default_" : {  
> "\_source" : {  
> "enabled" : false  
> },  
> "properties" : { }  
> }  
> }  
> }
> 
> Did you copy this file to all master-eligible nodes?
> 
> On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:
> 
> > Hi! Have anybody tried to load index settings template from file in  
> > config/templates like described here  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)? I'm  
> > using v19.10 and it works for me only through http API e.g. url -XPUT  
> > localhost:9200/\_template/template\_1 but not through file.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [April 18, 2013, 8:34pm UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/12 "2013-04-18T20:34:44Z")

</div>

This command only returns templates that were added using

curl -XPOST "localhost:9200/\_template/...."

and doesn't include templates specified in the config/templates directory.

On Thursday, April 18, 2013 8:24:30 AM UTC-4, gondo wrote:

> hi  
> when i try your steps i would expect to be able to GET template info as  
> well, however this command doesnt bring anything:  
> curl -XGET "localhost:9200/\_template/template\_1" && echo
> 
> im trying to confirm that my template is loading successfully from config  
> file, but i dont really know how  
> thanks
> 
> On Wednesday, 7 November 2012 11:04:32 UTC+11, Igor Motov wrote:
> 
> > It seems to be working fine for me.
> > 
> > ~/Software› curl -L -O  
> > [https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz](https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.10.tar.gz)  
> > % Total % Received % Xferd Average Speed Time Time Time  
> > Current  
> > Dload Upload Total Spent Left  
> > Speed  
> > 100 14.5M 100 14.5M 0 0 1904k 0 0:00:07 0:00:07 --:--:--  
> > 2148k  
> > ~/Software› tar -xzf elasticsearch-0.19.10.tar.gz  
> > ~/Software› cd elasticsearch-0.19.10  
> > ~/Software/elasticsearch-0.19.10› cd config  
> > ~/Software/elasticsearch-0.19.10/config› mkdir templates  
> > ~/Software/elasticsearch-0.19.10/config› cd templates  
> > ~/Software/elasticsearch-0.19.10/config/templates› curl -L -O  
> > [https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json](https://raw.github.com/gist/425bc2a1a29c42f2d896/template1.json)  
> > % Total % Received % Xferd Average Speed Time Time Time  
> > Current  
> > Dload Upload Total Spent Left  
> > Speed  
> > 103 414 103 414 0 0 707 0 --:--:-- --:--:-- --:--:--  
> > 6900  
> > ~/Software/elasticsearch-0.19.10/config/templates› cat template1.json  
> > {  
> > "template\_1" : {  
> > "template" : "\*",  
> > "settings" : {  
> > "index.number\_of\_shards" : 2  
> > },  
> > "mappings" : {  
> > "_default_" : {  
> > "\_source" : {  
> > "enabled" : false  
> > }  
> > },  
> > "type1" : {  
> > "\_all" : {  
> > "enabled" : false  
> > }  
> > }  
> > }  
> > }  
> > }  
> > ~/Software/elasticsearch-0.19.10/config/templates› cd ../..  
> > ~/Software/elasticsearch-0.19.10› bin/elasticsearch  
> > ~/Software/elasticsearch-0.19.10› curl -XPUT localhost:9200/new\_index &&  
> > echo  
> > {"ok":true,"acknowledged":true}  
> > ~/Software/elasticsearch-0.19.10› curl -XGET  
> > "localhost:9200/new\_index/\_settings?pretty=true" && echo  
> > {  
> > "new\_index" : {  
> > "settings" : {  
> > "index.number\_of\_shards" : "2",  
> > "index.number\_of\_replicas" : "1",  
> > "index.version.created" : "191099"  
> > }  
> > }  
> > }  
> > ~/Software/elasticsearch-0.19.10› curl -XGET  
> > "localhost:9200/new\_index/\_mapping?pretty=true" && echo  
> > {  
> > "new\_index" : {  
> > "type1" : {  
> > "\_all" : {  
> > "enabled" : false  
> > },  
> > "\_source" : {  
> > "enabled" : false  
> > },  
> > "properties" : { }  
> > },  
> > "_default_" : {  
> > "\_source" : {  
> > "enabled" : false  
> > },  
> > "properties" : { }  
> > }  
> > }  
> > }
> > 
> > Did you copy this file to all master-eligible nodes?
> > 
> > On Tuesday, November 6, 2012 10:39:13 AM UTC-5, Serg Pilipenko wrote:
> > 
> > > Hi! Have anybody tried to load index settings template from file in  
> > > config/templates like described here  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)? I'm  
> > > using v19.10 and it works for me only through http API e.g. url -XPUT  
> > > localhost:9200/\_template/template\_1 but not through file.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![gondo\_2](https://avatars.discourse-cdn.com/v4/letter/g/f08c70/32.png) [@gondo\_2](https://discuss.elastic.co/u/gondo_2)\
**Post date:** [April 24, 2013, 12:24pm UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/13 "2013-04-24T12:24:14Z")

</div>

hmm so there is no way to confirm that templates set in configuration  
were successfully parsed?

On Wednesday, 7 November 2012 02:39:13 UTC+11, Serg Pilipenko wrote:

> Hi! Have anybody tried to load index settings template from file in  
> config/templates like described here  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)? I'm  
> using v19.10 and it works for me only through http API e.g. url -XPUT  
> localhost:9200/\_template/template\_1 but not through file.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [April 24, 2013, 1:02pm UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/14 "2013-04-24T13:02:04Z")

</div>

Try creating an index and check the log files on master for errors.

On Wednesday, April 24, 2013 2:24:14 PM UTC+2, gondo wrote:

> hmm so there is no way to confirm that templates set in configuration  
> were successfully parsed?
> 
> On Wednesday, 7 November 2012 02:39:13 UTC+11, Serg Pilipenko wrote:
> 
> > Hi! Have anybody tried to load index settings template from file in  
> > config/templates like described here  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates.html)? I'm  
> > using v19.10 and it works for me only through http API e.g. url -XPUT  
> > localhost:9200/\_template/template\_1 but not through file.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:39am UTC](https://discuss.elastic.co/t/loading-of-index-settings-template-from-file-in-config-templates/9582/15 "2017-07-06T02:39:47Z")

</div>


