[syslog-ng]template_escape character not valid for oracle

Matt Scifo syslog-ng@lists.balabit.hu
26 Aug 2003 12:40:34 -0700


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?

Matt Scifo
mscifo@o1.com