Hi All
I have configured logstash and elasticsearch v7.8.
This is the logstash part
geoip {
source => "[iis][access][client_ip]"
}
Index template:
GET /_template/iis
{
"iis" : {
"order" : 0,
"version" : 60001,
"index_patterns" : [
"iis-*"
],
"settings" : {
"index" : {
"number_of_shards" : "1",
"number_of_replicas" : "0",
"refresh_interval" : "5s"
}
},
"mappings" : {
"dynamic_templates" : [
{
"message_field" : {
"path_match" : "message",
"mapping" : {
"norms" : false,
"type" : "text"
},
"match_mapping_type" : "string"
}
},
{
"string_fields" : {
"mapping" : {
"norms" : false,
"type" : "text",
"fields" : {
"keyword" : {
"ignore_above" : 256,
"type" : "keyword"
}
}
},
"match_mapping_type" : "string",
"match" : "*"
}
}
],
"properties" : {
"@timestamp" : {
"type" : "date"
},
"geoip" : {
"dynamic" : true,
"properties" : {
"ip" : {
"type" : "ip"
},
"latitude" : {
"type" : "half_float"
},
"location" : {
"type" : "geo_point"
},
"longitude" : {
"type" : "half_float"
}
}
},
"@version" : {
"type" : "keyword"
}
}
},
"aliases" : { }
}
}
Logstash logs:
[2020-09-02T09:53:22,106][WARN ][logstash.outputs.elasticsearch][main][e259a9c61a106fc2c0d1e50f28fad160c27a1537f119152edc21384c300f32c1] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"iis-2020.09.02", :routing=>nil, :_type=>"%{type}"}, #<LogStash::Event:0x7397c590>], :response=>{"index"=>{"_index"=>"iis-2020.09.02", "_type"=>"%{type}", "_id"=>"Hqw8TnQBA0raPCFaMvi1", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"mapper [geoip.location] of different type, current_type [geo_point], merged_type [ObjectMapper]"}}}}
Can someone let me know what am i doing wrong here?