Hi,
I have created my index pattern to map my csv file(geoLocation in geo_point)
'''
PUT _template/geotemplate
** {**
** "index_patterns": [**
** "flightgeolocation"**
** ],**
** "settings" : {},**
** "mappings": {**
** "properties": {**
** "geolocation" : {**
** "type" : "geo_point"**
** }**
** }**
** },**
** "aliases": {}**
** }**
'''
I updated my config file and I have made latitude and longitude in float type and put them as a new field (geLocation)
'''
input { stdin{} }
** filter {**
** csv {**
** separator => ","**
** columns => **
** ["Airport_ID","Name","City","Country","IATA",**
** "ICAO","Latitude","Longitude","Altitude","Timezone","DST",**
** "database_time_zone","Type","Source"]**
** }**
** mutate {convert => ["Airport_ID", "string"] }**
** mutate {convert => ["Name", "string"] }**
** mutate {convert => ["City", "string"] }**
** mutate {convert => ["Country", "string"] }**
** mutate {convert => ["IATA", "string"] }**
** mutate {convert => ["ICAO", "string"] }**
** mutate {convert => ["Latitude", "float"] }**
** mutate {convert => ["Longitude", "float"] }**
** mutate {convert => ["Altitude", "string"] }**
** mutate {convert => ["Timezone", "string"] }**
** mutate {convert => ["DST", "string"] }**
** mutate {convert => ["database_time_zone", "string"] }**
** mutate {convert => ["Type", "string"] }**
** mutate {convert => ["Source", "string"] }**
** mutate {**
** add_field => {**
** "geoLocation" => "%{Latitude},%{Longitude}"**
** }**
** }**
** }**
** output {**
** elasticsearch {**
** hosts => "localhost:9200"**
** index => "flight"**
** }**
** stdout { codec => rubydebug }**
** }**
'''
But I always have the same error :
'''
Guinea,GKA,AYGA,6.081689834590001,145.391998291,5282,10,U,PacificPort_Moresby,airport,OurAirports[2021-05-02T19:45:35,275][WARN ][logstash.outputs.elasticsearch][main][6f6097aabf7327a68ae97015b3ece31fcdcae152465b7ff4d6cd4d72dc9e602d] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"flight", :routing=>nil, :_type=>"_doc"}, #LogStash::Event:0x6001a384], :response=>{"index"=>{"_index"=>"flight", "_type"=>"_doc", "_id"=>"qWovLnkBE-V7VJ24f7oA", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [geoLocation] of type [geo_point]", "caused_by"=>{"type"=>"parse_exception", "reason"=>"latitude must be a number"}}}}}
'''
That say that latitude must be a number but that's a number.
Do you have an idea to resolve the problem ?