pino-elasticsearch icon indicating copy to clipboard operation
pino-elasticsearch copied to clipboard

Daily rotating dbs?

Open mzehrer opened this issue 6 years ago • 3 comments

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

mzehrer avatar Mar 30 '18 10:03 mzehrer

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

alexgoldstone avatar Apr 19 '18 12:04 alexgoldstone

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

tdeo avatar Jun 06 '19 13:06 tdeo

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

alexgoldstone avatar Jun 06 '19 14:06 alexgoldstone