pino-elasticsearch
pino-elasticsearch copied to clipboard
Daily rotating dbs?
Is ist possible to create daily rotating databases with pino-elasticsearch?
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
Just saw this, you can use the placeholder %{DATE}
introduced in this PR: https://github.com/pinojs/pino-elasticsearch/pull/22/files
I confirm that I have been using the %{DATE}
option for some time and it works well.