Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fluentd wildcard out_file with tag in file path

Tags:

fluentd

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?

like image 840
taxilian Avatar asked Sep 18 '14 19:09

taxilian


1 Answers

Use the fluent-plugin-forest plugin.

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

like image 198
Takahiko Kawasaki Avatar answered Oct 20 '22 17:10

Takahiko Kawasaki