5

I'm just getting started with fluentd, but I would like to be able to set up a single output match rule, like so:

<match myapp.**>
   type file
   path logs/
   time_slice_format %Y%m%dT%H
   time_slice_wait 5m
   time_format %Y%m%dT%H%M%S%z
</match>

This works great, but I would like to find a way to further add the name of the tag into the output filename; is this possible? For example, if I log with myapp.debug I would like it to write to logs/myapp.debug20140918T12_0.log, and if I log with myapp.info it would write to logs/myapp.info20140918T12_0.log etc

Is there a way to add the tag into the filename?

taxilian
  • 14,229
  • 4
  • 34
  • 73

1 Answers1

5

Use the fluent-plugin-forest plugin.

https://github.com/tagomoris/fluent-plugin-forest

Takahiko Kawasaki
  • 18,118
  • 9
  • 62
  • 105