Convert Float to Geo_Point

Hi,
i am trying to convert city name to location and see them in map ,
my the type of location.lat and location.lon are still float , i can't convert them to geo_point ,
my logstash.conf is :
input {
jdbc {
jdbc_connection_string => "jdbc:mysql://localhost:3306/zendb?zeroDateTimeBehavior=convertToNull&serverTimezone=Africa/Tunis"
jdbc_user => ""
jdbc_password => "
**"
jdbc_driver_library => "/root/mysql-connector-java-8.0.20/mysql-connector-java-8.0.20/mysql-connector-java-8.0.20.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
statement => "SELECT e.id_parent , sa.city , b.id_address_delivery, b.payment, b.current_state,b.id_order , b.id_carrier,a.product_id, b.date_add, b.delivery_date , d.`na$
}
}

filter {
translate {
field => "city"
dictionary_path => "/root/codebeautify.yaml"
fallback => "unknown"
destination=> "newlocation"
}
}
filter {
mutate {
split => {"newlocation" => ","}
}
}

filter {
mutate {
add_field => {"latitude" => "%{[newlocation][0]}" }
add_field => {"longitude"=> "%{[newlocation][1]}" }
}
}

filter {
mutate {
convert => { "longitude" => "float" }
convert => { "latitude" => "float" }
}
}

filter{
mutate {
rename => {
"longitude" => "[location][lon]"
"latitude" => "[location][lat]"
}
}
}

output {
elasticsearch {
"hosts" => "localhost:9200"
"index" => "zen"
manage_template => true
template => "/root/template.json"
template_overwrite=>"true"
"document_id" => "%{id_order}"
}

and my template.json is :
{
"index_patterns": ["zen"],
"settings": {
"number_of_shards": 5
},
"mappings": {
"properties": {
"location" : {
"properties" : {
"lat" : {
"type" : "geo_point"
},
"lon" : {
"type" : "geo_point"
}
}
}
}
}

lat and lon cannot independently be of type geo_point, the combination would have to be a geo_point.

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