[syslog-ng] Is it possible to replace a string with a new line using rewrite?

Luis Pugoy lpugoy at insynchq.com
Thu Sep 22 12:07:05 CEST 2011


>
>
> Message: 4
> Date: Wed, 21 Sep 2011 21:20:44 +0200
> From: Gergely Nagy <algernon at balabit.hu>
> Subject: Re: [syslog-ng] Is it possible to replace a string with a new
>        line    using rewrite?
> To: syslog-ng at lists.balabit.hu
> Message-ID: <87pqitr9bn.fsf at luthien.mhp>
> Content-Type: text/plain
>
> Luis Pugoy <lpugoy at insynchq.com> writes:
>
> > I am trying to replace a string with a newline using rewrite. Is it
> > possible? Thanks.
>
> rewrite r_nl {
>  subst("<insert regexp here>",
>       "\n", value("MSG"));
> };
>
> Or, if you want to replace the whole MSG with a newline:
>
> rewrite r_nlmsg { set("\n", value("MSG")); };
>
> --
> |8]
>
>
Thanks. I was using single quotes ('\n') so it wasn't working for me before.
I didn't realize that there's a distinction between single and double quotes
in syslog-ng.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20110922/5d4daa85/attachment.htm 


More information about the syslog-ng mailing list