I am facing some issue while defining mapping for an index
[2021-03-27T23:27:36,733][WARN ][logstash.outputs.elasticsearch][packetbeat][7bb6e349f13f74fc053ef83bdac5d84b4de038193ed7d008068e4432f88bd27d] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"log-pb-flow-2021.03.27", :routing=>nil, :_type=>"_doc"}, #<LogStash::Event:0x1b2d34b5>], :response=>{"index"=>{"_index"=>"log-pb-flow-2021.03.27", "_type"=>"_doc", "_id"=>"XzTVdHgBRP-3kKikkO1x", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [destination.location] of type [geo_point]", "caused_by"=>{"type"=>"parse_exception", "reason"=>"unsupported symbol [-] in geohash [-93.6112]", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"unsupported symbol [-] in geohash [-93.6112]"}}}}}}
logstash pipeline file
input {
beats {
port => 5044
}
}
filter {
if [agent][type]=="packetbeat" {
geoip {
add_tag => [ "GeoIP" ]
source => "[destination][ip]"
add_field => [ "[destination][location]", "%{[geoip][longitude]}" ]
add_field => [ "[destination][location]", "%{[geoip][latitude]}" ]
#database => "/usr/share/logstash/GeoLite2-City.mmdb"
}
}
}
output
{
if [agent][type]=="packetbeat" {
if[type]=="flow"
{
elasticsearch {
hosts => "localhost:9200"
manage_template => false
index => "log-pb-flow-%{+YYYY.MM.dd}"
}
}
}
}
My index template
PUT /_template/packetbeat_flow
{
"index_patterns": ["log-pb-flow-*"],
"settings": {
"number_of_replicas": 0
},
"mappings" : {
"properties": {
"client.ip":{"type": "ip",
"fields": {
"keyword":{"type":"keyword"}
}
},
"host.ip":{"type": "ip",
"fields": {
"keyword":{"type":"keyword"}
}
},
"server.ip":{"type": "ip",
"fields": {
"keyword":{"type":"keyword"}
}},
"source.ip":{"type": "ip",
"fields": {
"keyword":{"type":"keyword"}
}
},
"destination.ip" : { "type": "ip"
},
"destination.location" : {"type": "geo_point"},
"geoip" : {
"dynamic": true,
"properties" :
{
"ip":{"type":"ip"},
"latitude":{"type":"half_float",
"fields":{
"lat":{"type":"half_float"}
}
},
"longitude":{"type":"half_float",
"fields":{
"lat":{"type":"half_float"}
}
},
"location":{"type":"geo_point"}
}
}
}
}
}
i dont know where i am doing wrong