S3 output plugin prefix string interpolation

With the current Logstash version (5.3), and the S3 output plugin, I see the prefix option "supports string interpolation". My question is, can I interpolate based on current date/time, with multiple levels of directories, like this:

s3 {
  prefix => "logstash-test/%{+YYYY}/%{+MM}/%{dd}/"
}

Or am I restricted to string interpolation based strictly on simple field values like this:

s3 {
  prefix => "logstash-test/%{event}/"
}

My question is, can I interpolate based on current date/time, with multiple levels of directories, like this:

Yes, depending on what you mean by "current". %{+YYYY} and friends always look at the event's timestamp (the @timestamp field).

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.