Message: 4
Date: Wed, 21 Sep 2011 21:20:44 +0200
From: Gergely Nagy <algernon@balabit.hu>
Subject: Re: [syslog-ng] Is it possible to replace a string with a new
       line    using rewrite?
To: syslog-ng@lists.balabit.hu
Message-ID: <87pqitr9bn.fsf@luthien.mhp>
Content-Type: text/plain

Luis Pugoy <lpugoy@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.