Gurus,
I am recreating some work originally done in ES 5.X and I am hitting the multiple type issue. The original work can be found in github here. For some reason, and I cant explain why, when inserting entries they getting tagged with an type "doc", even though, I am not explicitly doing that anywhere.
The original project creates an index mapping for ES 5.X as shown here. I changed this template to work on ES 6.X as follows:
{
"template": "cucm-cdr*",
"settings": {
"number_of_shards": 5,
"number_of_replicas": 1
},
"mappings": {
"doc": {
"properties": {
"type": { "type": "keyword" },
"cdrRecordType" : { "type" : "integer" },
"globalCallID_callManagerId" : { "type" : "integer" },
"globalCallID_callId" : { "type" : "integer" },
...<SNIP>...
}
}
}
}
And then we load data using the logstash file input plugin.
Here is the logstash config:
input {
file {
path =>"/path/to/cdr*"
type => "cucm-cdr"
start_position => "beginning"
add_field => { "cucm_clustername" => "CUCM_Cluster_1" }
}
}
The full logstash config is here.
Now, when we load files via logstash I get the error:
[2018-09-21T00:54:10,919][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"cucm-cdr-21.09.2018", :_type=>"doc", :_routing=>nil}, #<LogStash::Event:0x12b7acb3>], :response=>{"index"=>{"_index"=>"cucm-cdr-21.09.2018", "_type"=>"doc", "_id"=>"-1F6-mUB7q-Yw141ZWFT", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Rejecting mapping update to [cucm-cdr-21.09.2018] as the final mapping would have more than 1 type: [cucm-cdr, doc]"}}}}
Where is the type doc getting set and more importantly how do I get rid of it? Thanks in advance!