[syslog-ng] $MSG value

Balazs Scheidler bazsi at balabit.hu
Wed Dec 13 09:39:10 CET 2006


On Tue, 2006-12-12 at 17:50 +0100, news gonzo news gonzo wrote:
> Hello,
> Should it be possible to modify the value of $MSG or
> $MSGONLY (with a tool like sed for example) ?
> 

not directly, you could do something similar with regexp match
variables, but it is not yet ideal:

filter f_match { match("(something happened to this host ([0-9\.]+))"); };

destination d_file { file("/var/log/messages" template("$DATE $HOST $2\n"); };

The value for $2 is the value matched by the second parenthesis in the 
last regexp matched.

-- 
Bazsi



More information about the syslog-ng mailing list