winston-elasticsearch
winston-elasticsearch copied to clipboard
ensureIndexTemplate and indexTemplate not working
I want to add mappings to the index using indexTemplate .
i set ensureIndexTemplate to true and i put indexTemplate: { mappings: { properties: { co: { index: true, type: "keyword", }, age: { type: "integer", }, }, }, }
but nothing happened.
I have the same problem.
same issue
same problem :(
I have the same issue
are you using data streams (dataStream: true
) and what means "but nothing happened."? Does that mean the template is not created?
are you using data streams (
dataStream: true
) and what means "but nothing happened."? Does that mean the template is not created?
Yes the template is not created, I'm not using data streams .
Which version of ES are you running?
I am trying to upgrade my plugin version, and I just found out 0.14.0 introduced a breaking change that only works on ES 7.8+. The new index template was introduced on ES 7.8, and those running 7.7- are bound to the legacy index template API calls.
I have added more debug code for this. So please try with the latest release and enable debug output.
Can someone follow up on this? Is this an issue with the ES version you are running?
I have the same issue with current 0.17.2 (@elastic/elasticsearch 8.8.1, running with ES 8.7.0) Tracking down in debug, I noticed that within the bulk_writer.js:206:
debug('Checking tpl name', tmplCheckMessage);
thiz.client.indices.existsIndexTemplate(tmplCheckMessage).then(
(res) => {
if (res.statusCode && res.statusCode === 404) {
For some reason res is false, so the template isn't created. Current workaround is to manually check & create the template but please fix this :/
@vanthome the issue happens because to get statusCode from existsIndexTemplate
you have to pass the 2nd parameter with enabled meta:
existsIndexTemplate(tmplCheckMessage, { meta: true })