Dd Geo Point From Twitter geo Field

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"
}
}
}

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

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"

          }

        }

      }

    ]

  }

}

}

}

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