Hello, I am new to ElasticSearch and I've read a few of the threads that track back to '17 but I cant seem to find a working solution as I've attempted some of the solutions so I was wondering if anyone could give some pointers!
[2019-01-18T14:16:15,698][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>"310946f7-bbfa-4de7-8fd3-86d6ee4e9480", :_index=>"logstash-txnsummary-2019.01.18", :_type=>"doc", :_routing=>nil}, #<LogStash::Event:0x17809485>], :response=>{"index"=>{"_index"=>"logstash-txnsummary-2019.01.18", "_type"=>"doc", "_id"=>"310946f7-bbfa-4de7-8fd3-86d6ee4e9480", "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.TextFieldMapper$TextFieldType != class org.elasticsearch.index.mapper.KeywordFieldMapper$KeywordFieldType on field orderOperationCorrelationID"}}}}}
And this is the output-elasticsearch.config on my machine..
output {
if (![log]) {
elasticsearch {
hosts => [ "${OUTPUT_ELASTICSEARCH_HOSTS}" ]
index => "${OUTPUT_ELASTICSEARCH_INDEX}"
action => "${OUTPUT_ELASTICSEARCH_ACTION:index}"
document_id => "%{logGUID}"
document_type => "${OUTPUT_ELASTICSEARCH_DOCUMENT_TYPE}"
retry_on_conflict => 50
template_name => "logstash-txnsummary"
manage_template => true
template_overwrite => true
template => "${CONFIG_DIR}/_/logs-elasticsearch-template.json"
}
}
}
And this is the mapping template below
{
"template": "logstash-txnsummary-*",
"settings": {
"index.refresh_interval": "5s"
},
"mappings": {
"logs": {
"_all": {
"enabled": true,
"omit_norms": true
},
"dynamic_templates": [
{
"message_field": {
"match": "message",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": "analyzed",
"omit_norms": true
}
}
},
{
"string_fields": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": "not_analyzed",
"ignore_above": 256
}
}
}
],
"properties": {
"orderOperationCorrelationID": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
I can see that the type are different, is that the offender?
type:string vs type:keyword?
I've tried by making a change to my output-elasticsearch.conf (instead of type string, use type keyword), and the errors are still there?