winston-elasticsearch
winston-elasticsearch copied to clipboard
ensureMappingTemplate & mappingTemplate seems not working
I tried to debug it at bulk_writer.js
thiz.client.indices.putTemplate(tmplMessage).then(
(res1) => {
debugger
fulfill(res1);
},
(err1) => {
debugger
reject(err1);
}
);
and it fall to catch with error
[mapper_parsing_exception] Root mapping definition has unsupported parameters: [severity : {index=true, type=keyword}] [@timestamp : {type=date}]
mappingTemplate is exactly as in template
I cannot confirm this, have you tried this with a fresh instance of ES? I could imagine that you already have an index pattern or your version of ES is not recent enough...
Are you using elasticsearch 6 or 7? This was happening with 6.. now recent PR fixed it (on master now.. didn't release yet).
A bigger issue is that this silently fails. Versions:
Elasticsearch: 7
"winston": "^3.2.1",
"winston-elasticsearch": "0.15.5"
I had to deduce that the problem was actually here with a lot of trial and error. The package should instead throw an error / cause connection failure to elastic in case of incorrect configuration.
This is a flaky bug. It sometimes happens and sometimes doesn't. Anyways, the problem goes away if I create the template myself.