[syslog-ng] How to use parser
Balazs Scheidler
bazsi at balabit.hu
Sat Feb 25 16:49:20 CET 2012
On Wed, 2012-02-08 at 14:57 +0900, 大町 靖 wrote:
> Hello Robert,
>
> Thanks for your effort.
>
> I rewrite the configurtion below.
>
> parser p1{
> csv-parser(columns("Msg1","Msg2")
> delimiters("#AA#")
> # template ("$Msg1\n$Msg2");
> };
>
> destination d_mesge { file("/var/log/messages" template("$MSG1\nMSG2\n")); };
>
> log { source(s_sys); parser(p1); destination(d_mesg); };
>
>
> But the result isn't unexpected.
>
> I want to divide by "#AA#". ("#AA#" is a string.)
> It seems that the result is divided by the '#' or 'A' . (character).
>
> For example, the messages is "12A456 #AA# 789".
> The result is MSG1 = 12 MSG2=456.
> I expect that MSG1=12A456 MSG2=789.
>
> What should I do ?
Well, the csv-parser() only supports single character separators, and if
you supply multiple characters, any of those would terminate a field.
--
Bazsi
More information about the syslog-ng
mailing list