Hi,
is there a way to define constants in fluentd?
I've got several config files (sources) which loads from unified log-files. But I'd like to store the format in a central place.
<source>
type tail
format multiline
format_firstline /^\d{4}-\d{1,2}-\d{1,2}/
format1 /^(?<time>\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2},\d{3}) (?<level>.*) \[(?<thread>.*)\] (?<logger>[^ ]*) (?<message>.*)/
path /var/log/service-a.log
read_from_head true
tag service.a
refresh_interval 30
</source>
<source>
type tail
format multiline
format_firstline /^\d{4}-\d{1,2}-\d{1,2}/
format1 /^(?<time>\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2},\d{3}) (?<level>.*) \[(?<thread>.*)\] (?<logger>[^ ]*) (?<message>.*)/
path /var/log/service-b.log
read_from_head true
tag service.b
refresh_interval 30
</source>
...
Is there any way to achive that?
Or can I define a <source> which reads all the logfiles and depending on the logfile-name it will append the tag correctly?
Thanks
Marc