So i'm doing a csv output automation where i want my exported csv file to be named like
data-2019.07.01.csv
but naming/creating the new file only occur every monday (weekly) so the file will contain data from July 1st-7th,
and the next monday logstash would create:
data-2019.07.08.csv (will contain data from july 8th-14th).
Maybe odd, but i'm thinking like adding new field which has value day of year like:
day: "Mon"
so when it's monday the output will be like:
path => "/tmp/data-%{+yyyy.MM.dd}"
but on other day like:
day: "Tue"
the output will be like:
path => "/tmp/data-%{+yyyy.MM.**(dd-1)**}"
The whole output will be like:
output { if [day] == "Mon" csv { path => "/tmp/data-%{+yyyy.MM.dd}" } } else if [day] == "Tue" { csv { path => "/tmp/data-%{+yyyy.MM.(dd-1)}" } } else if [day] == "Wed" { csv { path => "/tmp/data-%{+yyyy.MM.(dd-2)}" } } ... and so on }
*Event better if the file could be named data-2019.07.01-2019.07.07.csv.
is that close to posibility? Hope someone can help. thanks in advance.