# Logstash - Elastisearch template

**URL:** <https://discuss.elastic.co/t/logstash-elastisearch-template/55774>\
**Category:** Logstash\
**Created:** [July 18, 2016, 2:49pm UTC](https://discuss.elastic.co/t/logstash-elastisearch-template/55774 "2016-07-18T14:49:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diego\_Gomez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diego_gomez/32/12893_2.png) [@Diego\_Gomez](https://discuss.elastic.co/u/Diego_Gomez)\
**Post date:** [July 18, 2016, 2:49pm UTC](https://discuss.elastic.co/t/logstash-elastisearch-template/55774/1 "2016-07-18T14:49:33Z")

</div>

Hi, I'm working with twitter and want to map coordinates for the reconnoitre Kibana . This is my template.json

```
{
 "template": "twitter",
 "order": 1,
"settings": {
 "number_of_shards": 1
},
"mappings": {
"tweet": {
  "_all": {
    "enabled": false
  },
  "dynamic_templates" : [ {
     "message_field" : {
       "match" : "message",
       "match_mapping_type" : "string",
       "mapping" : {
         "type" : "string", "index" : "analyzed", "omit_norms" : true
       }
     }
   }, {
     "string_fields" : {
       "match" : "*",
       "match_mapping_type" : "string",
       "mapping" : {
         "type" : "string", "index" : "analyzed", "omit_norms" : true,
           "fields" : {
             "raw" : {"type": "string", "index" : "not_analyzed", "ignore_above" : 256}
           }
       }
     }
   } ],
  "properties": {
    "text": {
      "type": "string"
    },
      "coordinates": {
      "properties": {
         "coordinates": {
            "type": "geo_point"
         },
         "type": {
            "type": "string"
         }
      }
    }
     }
   }
 }
}

```

This is my logstash.conf file

```
input {
    twitter {
      consumer_key => "l5KGrXvRywF3QMxhD0ab4slIA"
      consumer_secret => "qYoz4ooYM2O5ir9W9ECSsZfO7oLE8tHZvX1wlq9pH2KwHUjziC"
        oauth_token => "738404980470730752-lrULPA0EEPZHlMDOyDNVoSFdfvykyKJ"
      oauth_token_secret => "ydtfWx6QZ5a5CTG1R2rA7wCTcBwBVElvOfdVP9Uxo3JE3"
       keywords => ["tecnologia"]
     full_tweet => true
  ignore_retweets => true
}
 }

filter {
}

 output {
   stdout { codec => rubydebug }
elasticsearch {
hosts => ["localhost:9200"]
index => "twitter4"
document_type => "tweet"
template => "twitter_template.json"
template_name => "twitter"
user => "twitter"

  }
}

```

This is the error,  
does not take twitter\_template.jason

---

<div class="post-metadata">

**Author:** ![Diego\_Gomez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diego_gomez/32/12893_2.png) [@Diego\_Gomez](https://discuss.elastic.co/u/Diego_Gomez)\
**Post date:** [July 18, 2016, 3:00pm UTC](https://discuss.elastic.co/t/logstash-elastisearch-template/55774/2 "2016-07-18T15:00:41Z")

</div>

Error

Required argument 'body' missing {:class=\>"ArgumentError", :level=\>:error}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 18, 2016, 3:50pm UTC](https://discuss.elastic.co/t/logstash-elastisearch-template/55774/3 "2016-07-18T15:50:15Z")

</div>

The template pattern

```
"template": "twitter",

```

doesn't match the name of your index:

```
index => "twitter4"

```

But I don't think that's related to your error. Aren't there any more messages in the log? The first thing I'd try is making the path to the template JSON in the `template` option an absolute path.

---

<div class="post-metadata">

**Author:** ![Diego\_Gomez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diego_gomez/32/12893_2.png) [@Diego\_Gomez](https://discuss.elastic.co/u/Diego_Gomez)\
**Post date:** [July 18, 2016, 4:02pm UTC](https://discuss.elastic.co/t/logstash-elastisearch-template/55774/4 "2016-07-18T16:02:21Z")

</div>

The path to template.json equals of logstash.conf

etc/logstash/conf.d/logstash.conf

etc/logstash/conf.d/template.json

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 18, 2016, 4:07pm UTC](https://discuss.elastic.co/t/logstash-elastisearch-template/55774/5 "2016-07-18T16:07:04Z")

</div>

What makes you assume that Logstash reads template files relative to /etc/logstash/conf.d? Which version of the elasticsearch output plugin do you have?

---

<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, 4:47am UTC](https://discuss.elastic.co/t/logstash-elastisearch-template/55774/6 "2017-07-06T04:47:31Z")

</div>


