# Logstash and geopoint error, several types for the same field

**URL:** <https://discuss.elastic.co/t/logstash-and-geopoint-error-several-types-for-the-same-field/76959>\
**Category:** Logstash\
**Created:** [March 1, 2017, 9:48am UTC](https://discuss.elastic.co/t/logstash-and-geopoint-error-several-types-for-the-same-field/76959 "2017-03-01T09:48:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DrBatoon](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@DrBatoon](https://discuss.elastic.co/u/DrBatoon)\
**Post date:** [March 1, 2017, 9:48am UTC](https://discuss.elastic.co/t/logstash-and-geopoint-error-several-types-for-the-same-field/76959/1 "2017-03-01T09:48:56Z")

</div>

Hi! Im trying to load tweets directly into elasticsearch 5.2.1 via logstash. If I'm just running the logstash file before setting up my mapping, all fields except geoloca with the type geo\_point are fine. Therefore I am placing a mapping like this before to set type of geoloca:

```
PUT twitter
{
  "mappings": {
    "tweet": { 
      "_all": { "enabled": false }, 
      "properties": {  
        "twitter_text": { "type": "string", "fielddata": true }, 
        "hashtags": { "type": "string", "fielddata": true }, 
        "user": { "type": "string" },
        "country": { "type": "string" },
        "geoloca": { "type": "geo_point" }

      } } } }

```

And this is my logstash conf file.

```
input {  
      file {
        	path => "/root/Twitter/dataES.csv"
        	start_position => "beginning"
        	sincedb_path => "/dev/null"
      }
}

filter {  
    csv {
    	columns => ['logtime', 'twitter_text', 'hashtags', 'user', 'country', 'longitude', 'latitude']
        separator => ","
    }
    date {
    	match => ["logtime", "yyyy-MM-dd HH:mm:ss"]
    	timezone => "Europe/London"
    	target => "time"
    }
    mutate { convert => {"latitude" => "float"} }
    mutate { convert => {"longitude" => "float"} }
    mutate { rename => {"latitude" => "[geoloca][lat]"} }
    mutate { rename => {"longitude" => "[geoloca][lon]"} }   
    mutate { remove_field => ["message", "host", "@version", "path", "tags", "column6", "logtime"]}

}

output {
  elasticsearch { 
  	hosts => [" ******* :9200"]
    index => "twitter"
    }
}

```

From the logfile, the error I can read is

`"type"=>"illegal_argument_exception", "reason"=>"[geoloca] is defined as an object in mapping [logs] but this name is already used for a field in other types"`

What is the problem? I really can't figure out whats wrong.

---

<div class="post-metadata">

**Author:** ![DrBatoon](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@DrBatoon](https://discuss.elastic.co/u/DrBatoon)\
**Post date:** [March 1, 2017, 10:39am UTC](https://discuss.elastic.co/t/logstash-and-geopoint-error-several-types-for-the-same-field/76959/2 "2017-03-01T10:39:22Z")

</div>

Solved it by putting `type => "tweet`" in the input {file {

---

<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:** [March 29, 2017, 10:39am UTC](https://discuss.elastic.co/t/logstash-and-geopoint-error-several-types-for-the-same-field/76959/3 "2017-03-29T10:39:55Z")

</div>

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