[syslog-ng]template_escape character not valid for oracle

Balazs Scheidler syslog-ng@lists.balabit.hu
Wed, 27 Aug 2003 13:42:10 +0200


On Tue, Aug 26, 2003 at 12:40:34PM -0700, Matt Scifo wrote:
> Hello
> 
> I just started using syslog-ng with an oracle database as my
> destination.  I have discovered that Oracle does not accept a backslash
> as an escape character (I thought backslash was a standard).
> 
> The following query does not work in Oracle...
> 
> INSERT INTO messages (ID, TIMESTAMP, HOST ,FACILITY, PRIORITY, TAG,
> PROGRAM, MESSAGE) VALUES ('', to_date('2003-08-26 11:51:00', 'yyyy-mm-dd
> hh24:mi:ss'), 'host1', 'local0', 'warning', '84', '1', 'STOP:
> \'edrasmu\' message')
> 
> It will only accept a single quote for escaping a single quote...
> 
> INSERT INTO messages (ID, TIMESTAMP, HOST ,FACILITY, PRIORITY, TAG,
> PROGRAM, MESSAGE) VALUES ('', to_date('2003-08-26 11:51:00', 'yyyy-mm-dd
> hh24:mi:ss'), 'host1', 'local0', 'warning', '84', '1', 'STOP:
> ''edrasmu'' message')
> 
> How hard would it be to change the escape character that syslog-ng is
> looking for, or even better, make a template_escape(string) option which
> accepts a custom escape string?  Where is the code that handles the
> escaping of characters located in the source?

you are looking for macros.c, append_string function, currently the escaping
via '\' is absolutely wired in.

-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1