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

Daily rotating dbs? #17

Open
mzehrer opened this issue Mar 30, 2018 · 3 comments
Open

Daily rotating dbs? #17

mzehrer opened this issue Mar 30, 2018 · 3 comments

Comments

@mzehrer
Copy link

mzehrer commented Mar 30, 2018

Is ist possible to create daily rotating databases with pino-elasticsearch?

@alexgoldstone
Copy link

I believe this will be a feature request... I came here with the same requirement...

Currently pino-elasticsearch provides a --index option.

We require an additional option to specify a time-based index.

Rather than making the format totally dynamic - I propose this is limited to daily, monthly or yearly resolution inline with the Elastic Search documentation here:

https://www.elastic.co/guide/en/elasticsearch/guide/current/retiring-data.html

Examples:

For --index logs --index-time year the index would be in the form logs_2018
For --index logs --index-time month the index would be in the form logs_2018-04
For --index logs --index-time day the index would be in the form logs_2018-04-19

@tdeo
Copy link
Contributor

tdeo commented Jun 6, 2019

Just saw this, you can use the placeholder %{DATE} introduced in this PR: https://github.com/pinojs/pino-elasticsearch/pull/22/files

@alexgoldstone
Copy link

I confirm that I have been using the %{DATE} option for some time and it works well.

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

3 participants