# Dd Geo Point From Twitter geo Field

**URL:** <https://discuss.elastic.co/t/dd-geo-point-from-twitter-geo-field/214716>\
**Category:** Logstash\
**Created:** [January 12, 2020, 6:02am UTC](https://discuss.elastic.co/t/dd-geo-point-from-twitter-geo-field/214716 "2020-01-12T06:02:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shakesperoo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shakesperoo/32/20832_2.png) [@shakesperoo](https://discuss.elastic.co/u/shakesperoo)\
**Post date:** [January 12, 2020, 6:02am UTC](https://discuss.elastic.co/t/dd-geo-point-from-twitter-geo-field/214716/1 "2020-01-12T06:02:33Z")

</div>

how to add Geo Point From Twitter geo ?  
i am using twiiter API like this  
input {  
twitter {  
consumer\_key =\> ""  
consumer\_secret =\> ""  
oauth\_token =\> ""  
oauth\_token\_secret =\> ""  
keywords =\> ["USA"]  
full\_tweet =\> true  
type =\> "tweet"  
}  
}

and i want to index twitter geo field as geo point ny using mutue

i tried this but it didnt work

if [geo.coordinates] {  
mutate {  
add\_field =\> {  
"[location][lat]" =\> "%{XCent}"  
"[location][lon]" =\> "%{YCent}"  
}  
}  
mutate {  
convert =\> {  
"[location][lat]" =\> "float"  
"[location][lon]" =\> "float"  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [January 12, 2020, 3:03pm UTC](https://discuss.elastic.co/t/dd-geo-point-from-twitter-geo-field/214716/2 "2020-01-12T15:03:04Z")

</div>

If you want that field to be a geo\_point then you will need an index template that tells elasticsearch that.

---

<div class="post-metadata">

**Author:** ![shakesperoo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shakesperoo/32/20832_2.png) [@shakesperoo](https://discuss.elastic.co/u/shakesperoo)\
**Post date:** [January 12, 2020, 3:09pm UTC](https://discuss.elastic.co/t/dd-geo-point-from-twitter-geo-field/214716/3 "2020-01-12T15:09:10Z")

</div>

i did but the issue is

org.elasticsearch.ElasticsearchParseException: field must be either [lat], [lon] or [geohash]

my template is

{

```
"template": "momp_tweets",

"settings": {

  "index.mapping.total_fields.limit": 2000000000,

  "number_of_shards": 1,

  "number_of_replicas": 0,

  "mapping": {

    "total_fields": {

      "limit": "2000000000"

    }

  }

},

"mappings": {

  "tweet": {

    "properties": {

      "@timestamp": {

        "type": "date",

        "format": "dateOptionalTime"

      },

      "text": {

        "type": "text"

      },

      "user": {

        "type": "object",

        "properties": {

          "description": {

            "type": "text"

          }

        }

      },

                        

       "coordinates": {

          "type": "geo_point"

        },

        "type":{

          "type": "text",

          "fields": {

            "keyword":{

              "type":"keyword",

              "ignore_above": 256

            }

          }

        }

                

      ,

      "entities": {

        "type": "object",

        "properties": {

          "hashtags": {

            "type": "object",

            "properties": {

              "text": {

                "type": "text",

                "fielddata": true

              }

            }

          }

        }

      },

      "retweeted_status": {

        "type": "object",

        "properties": {

          "text": {

            "type": "text"

          }

        }

      }

    },

    "dynamic_templates": [

      {

        "string_template": {

          "match": "*",

          "match_mapping_type": "string",

          "mapping": {

            "type": "keyword"

          }

        }

      }

    ]

  }

}

```

}

}

---

<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:** [February 9, 2020, 3:09pm UTC](https://discuss.elastic.co/t/dd-geo-point-from-twitter-geo-field/214716/4 "2020-02-09T15:09:16Z")

</div>

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