Hello,
I'm using Elastic Stack since few days and I'm having some difficulties to convert latitude and longitude into geo_point type, I also try many solution on this forum but I can't resolve my problem . I work on Logstash 5.4 , there is my conf file :
input {
file{
path => "C:\Users\martinfm\Documents\ELK\gps_again2.txt"
start_position => "beginning"
type => "caisse"
}
}
filter{
csv{
separator => ","
columns => ["numcr","nomcaisse","latitude","longitude"]
}
geoip {
source => "caissegps"
target => "geoip"
add_field => [ "[geoip][location]", "%{[longitude]}" ]
add_field => [ "[geoip][location]", "%{[latitude]}" ]
}
mutate {
convert => [ "[geoip][location]", "float" ]
}
}
output {
elasticsearch{
hosts => "http://localhost:9200"
index => "sfclog_gps"
template => "C:\Users\martinfm\Documents\ELK\logstash-5.4.0\etc\templates\project.json"
template_name => "gps_logstash"
template_overwrite => true
}
}
And there is my template used :
{
"template" : "gps_logstash",
"settings" : { "index.refresh_interval" : "60s" },
"mappings" : {
"_default_" : {
"_all" : { "enabled" : false },
"dynamic_templates" : [{
"message_field" : {
"match" : "message",
"match_mapping_type" : "string",
"mapping" : { "type" : "string", "index" : "not_analyzed" }
}
}, {
"string_fields" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : { "type" : "string", "index" : "not_analyzed" }
}
}],
"properties" : {
"@timestamp" : { "type" : "date", "format" : "dateOptionalTime" },
"@version" : { "type" : "integer", "index" : "not_analyzed" },
"numcr" : { "type" : "integer" },
"nomcaisse" : { "type" : "string"},
"geoip" : { "type" : "object", "properties" : { "location" : { "type" : "geo_point" } } }
}
}
}
}
I saw this error on kibana : No Compatible Fields: The "sfclog_gps" index pattern does not contain any of the following field types: geo_point
And I notice my field numcr isn't an integer on kibana : host.keyword string
Did logstash don't use my template? If I try this : curl localhost:9200/_template/gps_logstash?pretty
, I find my custom template, I don't understand.
Any idea what I am doing wrong here? Regards, Florian.
Sorry for my poor English