Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impossible to make indexPrefix working #190

Open
Benraay opened this issue Jun 29, 2021 · 3 comments
Open

impossible to make indexPrefix working #190

Benraay opened this issue Jun 29, 2021 · 3 comments

Comments

@Benraay
Copy link

Benraay commented Jun 29, 2021

Hi,
thanks for the job you made on this, it was really helpful for me, however I can't get the "indexPrefix" option working

I tried adding it like this
const esTransportOpts = { level: 'info', clientOpts: { node: "XXXXX" }, source: NODE_ENV, indexPrefix:"scraper" };

But I always have an error "illegal_argument_exception"

Is there any other parameter I need to set ?
for now I'm using the default "logs" indexPrefix but I want to put it on another service and I'm stuck with it

the only way I found was specifying the "index" option but there is no way to have the index per day like default feature

@vanthome
Copy link
Owner

For me this is working fine with the latest version. I just set in test.js in the options indexPrefix: 'scraper'
and after running the test, I have an index called scraper-2021.07.15.
Are you using the latest version?

@Benraay
Copy link
Author

Benraay commented Jul 16, 2021

Hi, here is the whole error message : illegal_argument_exception: [illegal_argument_exception] Reason: index template [template_scraper] has index patterns [logs-app-default*] matching patterns from existing templates [template_logs] with patterns (template_logs => [logs-app-default*]) that have the same priority [200], multiple index templates may not match during index creation, please use a different priority maybe there is some other configuration to change somewhere, thanks for your help

@vanthome
Copy link
Owner

I suppose you are using an ES instance that might already have older indexes. Can you maybe try to rempty all data in your ES instance and let the logger set the templates etc. anew?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants