i did a manual mapping in Elasticsearch. but i am getting the below error. Can you please help.
Failed action. {:status=>400, :action=>["index", {:_id=>nil, :index=>"netflow", :_type=>"logs", :_routing=>nil}, #<LogStash::Event:0x481034c7 @metadata_accessors=#<LogStash::Util::Accessors:0x7b26b09 @store={}, @lut={}>, @cancelled=false, @data={"tag"=>0, "as_src"=>0, "label"=>"DFW1", "ip_src"=>"10.160.10.31", "packets"=>1, "country_ip_dst"=>"", "as_dst"=>0, "peer_ip_src"=>"10.0.11.252", "bytes"=>55, "iface_out"=>30, "iface_in"=>18, "ip_dst"=>"10.160.22.31", "mask_src"=>0, "mask_dst"=>0, "port_src"=>45005, "port_dst"=>15353, "stamp_inserted"=>"2016-07-12 15:48:00", "country_ip_src"=>"", "ip_proto"=>"udp", "stamp_updated"=>"2016-07-12 15:51:10", "@version"=>"1", "@timestamp"=>"2016-07-12T15:54:37.015Z"}, @metadata={}, @accessors=#<LogStash::Util::Accessors:0x6e830327 @store={"tag"=>0, "as_src"=>0, "label"=>"DFW1", "ip_src"=>"10.160.10.31", "packets"=>1, "country_ip_dst"=>"", "as_dst"=>0, "peer_ip_src"=>"10.0.11.252", "bytes"=>55, "iface_out"=>30, "iface_in"=>18, "ip_dst"=>"10.160.22.31", "mask_src"=>0, "mask_dst"=>0, "port_src"=>45005, "port_dst"=>15353, "stamp_inserted"=>"2016-07-12 15:48:00", "country_ip_src"=>"", "ip_proto"=>"udp", "stamp_updated"=>"2016-07-12 15:51:10", "@version"=>"1", "@timestamp"=>"2016-07-12T15:54:37.015Z"}, @lut={"type"=>[{"tag"=>0, "as_src"=>0, "label"=>"DFW1", "ip_src"=>"10.160.10.31", "packets"=>1, "country_ip_dst"=>"", "as_dst"=>0, "peer_ip_src"=>"10.0.11.252", "bytes"=>55, "iface_out"=>30, "iface_in"=>18, "ip_dst"=>"10.160.22.31", "mask_src"=>0, "mask_dst"=>0, "port_src"=>45005, "port_dst"=>15353, "stamp_inserted"=>"2016-07-12 15:48:00", "country_ip_src"=>"", "ip_proto"=>"udp", "stamp_updated"=>"2016-07-12 15:51:10", "@version"=>"1", "@timestamp"=>"2016-07-12T15:54:37.015Z"}, "type"]}>>], :response=>{"create"=>{"index"=>"netflow", "_type"=>"logs", "_id"=>"AVXf0TPx-AQHNLHZG1yY", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse", "caused_by"=>{"type"=>"illegal_state_exception", "reason"=>"Mixing up field types: class org.elasticsearch.index.mapper.core.LongFieldMapper$LongFieldType != class org.elasticsearch.index.mapper.ip.IpFieldMapper$IpFieldType on field ip_src"}}}}, :level=>:warn}
Below is my template config:
curl -XGET localhost:9200/template/*?pretty
{
"my_logs" : {
"order" : 1,
"template" : "netflow*",
"settings" : {
"index" : {
"number_of_shards" : "1",
"number_of_replicas" : "0"
}
},
"mappings" : {
"logs" : {
"properties" : {
"ip_proto" : {
"type" : "string"
},
"iface_in" : {
"type" : "long"
},
"iface_out" : {
"type" : "long"
},
"src_host_country" : {
"type" : "geo_point"
},
"peer_ip_src" : {
"type" : "ip"
},
"ip_src" : {
"type" : "ip"
},
"port_dst" : {
"type" : "long"
},
"port_src" : {
"type" : "long"
},
"ip_dst" : {
"type" : "ip"
},
"as_src" : {
"type" : "long"
},
"@timestamp" : {
"type" : "date"
},
"mask_dst" : {
"type" : "ip"
},
"mask_src" : {
"type" : "ip"
},
"dst_host_country" : {
"type" : "geo_point"
},
"as_dst" : {
"type" : "long"
}
}
}
},
"aliases" : { }
}
}