On Tue, 11 Oct 2011, Ryan Kelly wrote:

List:

I'm wondering if it is possible to match on and extract some value from
the syslog message, and use that in a template for a file name? I'm
pretty sure this isn't available, or probably even a good idea.

What I had in mind was something like:

if $msg matches '[someflag:(\d+)]' then "/var/log/flagged-$1.log"

So that the matched value's first capture can be used in the template
(obviously incomplete and obviously the 'matches' operator isn't real,
but hopefully you all get the idea).

the string created by the dynafile template is passed to the OS to create the filename (and path), so anything that you can do in a template can be part of the filename.

David Lang
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

Reply via email to