# Defined Template from logstash not being used by elastic search for mapping

**URL:** <https://discuss.elastic.co/t/defined-template-from-logstash-not-being-used-by-elastic-search-for-mapping/87037>\
**Category:** Elasticsearch\
**Created:** [May 24, 2017, 8:11pm UTC](https://discuss.elastic.co/t/defined-template-from-logstash-not-being-used-by-elastic-search-for-mapping/87037 "2017-05-24T20:11:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ImTheDeveloper](https://avatars.discourse-cdn.com/v4/letter/i/7ba0ec/32.png) [@ImTheDeveloper](https://discuss.elastic.co/u/ImTheDeveloper)\
**Post date:** [May 24, 2017, 8:11pm UTC](https://discuss.elastic.co/t/defined-template-from-logstash-not-being-used-by-elastic-search-for-mapping/87037/1 "2017-05-24T20:11:51Z")

</div>

Hi all,

I have the following logstash output config to go into elasticsearch from a postgres database

> **[input { jdbc { # Postgres jdbc connection string to our databa -...](https://pastebin.com/BFCH3tuZ)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

I have defined the location and my template as the following:

> **[{ "template": "universe\_elastic", "settings": { "analy -...](https://pastebin.com/mK5qshKM)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

When I run logstash I see the output as follows:

```
[2017-05-24T20:54:10,828][INFO][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://localhost:9200/, :path=>"/"}
[2017-05-24T20:54:10,982][WARN][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=>#<URI::HTTP:0xff97ab URL:http://localhost:9200/>}
[2017-05-24T20:54:10,985][INFO][logstash.outputs.elasticsearch] Using mapping template from {:path=>"/etc/logstash/universe_template.json"}
[2017-05-24T20:54:11,045][INFO][logstash.outputs.elasticsearch] Attempting to install template {:manage_template=>{"template"=>"universe_elastic", "settings"=>{"analysis"=>{"filter"=>{"gr$
[2017-05-24T20:54:11,052][INFO][logstash.outputs.elasticsearch] Installing elasticsearch template to _template/universe_elastic
[2017-05-24T20:54:11,145][INFO][logstash.outputs.elasticsearch] New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>[#<URI::Generic:0xe60519 URL://localhost:9200$
[2017-05-24T20:54:11,154][INFO][logstash.pipeline] Starting pipeline {"id"=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inf$
[2017-05-24T20:54:11,988][INFO][logstash.pipeline] Pipeline main started
[2017-05-24T20:54:12,079][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=>9600}
[2017-05-24T20:54:12,108][INFO][logstash.inputs.jdbc] (0.101000s) select planet.id, planet.x || ':' || planet.y || ':' || planet.z coords, planet.x, planet.y, planet.z ,planetname,ru$
[2017-05-24T20:54:15,006][WARN][logstash.agent] stopping pipeline {:id=>"main"}

```

When I query elasticseach templates I can see my template listed at:

> [http://xxxx:9200/\_template/](http://xxxx:9200/_template/)  
> {  
> "universe\_elastic": {  
> "order": 0,  
> "template": "universe\_elastic",  
> "settings": {  
> "index": {  
> "analysis": {  
> "filter": {  
> "gramFilter": {  
> "token\_chars": [  
> "letter",  
> "digit",  
> "punctuation",  
> "symbol"  
> ], ETC ETC ETC......

However when I run a check on my "universe" index the mapping haven't come through:

> **[{ "universe": { "aliases": {}, "mappings": { "planet": { -...](https://pastebin.com/hw9hYfLn)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

I would expect to see the \_all field and the include in all references set to true/false. But nothing.. Also the queries do not then use the analyzers I have specified.

Any ideas what might be going wrong here? I have deleted out all the other possible templates created as well as re-created indexes etc.

---

<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:** [May 25, 2017, 7:36am UTC](https://discuss.elastic.co/t/defined-template-from-logstash-not-being-used-by-elastic-search-for-mapping/87037/2 "2017-05-25T07:36:30Z")

</div>

> [@ImTheDeveloper](#):
>
> "template": "universe\_elastic",

The template will apply to indices named `universe_elastic` not just `universe`. Change this to `universe` or `universe*` in order to make it apply.

---

<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:** [June 22, 2017, 7:36am UTC](https://discuss.elastic.co/t/defined-template-from-logstash-not-being-used-by-elastic-search-for-mapping/87037/3 "2017-06-22T07:36:30Z")

</div>

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