One match rule and multiple logging files

52 views
Skip to first unread message

Emanuele Bastianelli

unread,
Jun 23, 2016, 8:14:22 AM6/23/16
to Fluentd Google Group
Hi all,

I'm a very new user in Fluentd. I'm trying to understand if it is possible to have a single match rule that write to different log files. More specifically, I'd like to write a match rule for a http source, that given a certain part of the accepted URL, will redirect the output to a specific file. The match rule would be something like:

<match myapp.*>
  @type file
  # something that will parse the tag and extract the string corresponding to *
  path /var/log/fluent/access+*
</match>


so that if Flunetd receive the request


it will write the output to a file like 

access1.[date_string]

and if it receives 


it will write to

access2.[date_string]

I know I might write a match rule for every possible path, but I'd like it to be dynamic. I understood I might do it embedding a little bit of Ruby inside the matching rule, but the syntax to use is not particularly clear from the config file documentation. Moreover, if there's a more specific guide and examples of the config file documentation, can you point it at me?

Thank you very much

Mr. Fiber

unread,
Jun 25, 2016, 3:16:45 AM6/25/16
to Fluentd Google Group
For tag and tag parts, you can use fluent-plugin-forest plugin for dynamic configuration.



I understood I might do it embedding a little bit of Ruby inside the matching rule

This is interpreted during parsing phase so this feature doesn't help your runtime case.


Masahiro

--
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages