[syslog-ng]Syslog-ng-Mysql error

Venkata Phani Kiran Achanta syslog-ng@lists.balabit.hu
Tue, 6 Jul 2004 17:12:11 -0700


Greetings all,
=20
    Everything was going well until I got this error while loading the
    Mysql tables....

    DBD::mysql::db do failed: You have an error in your SQL syntax.
Check
    the manual that corresponds to your MySQL server version for the
right
    syntax to use near '192.168.254.250', 'auth', 'notice', 'notice',
    '25', '2004-07-01 at ./db-loader.pl line 19, <FH> line 1.

    And my line 1 in mysql.pipe looks like this
=20
    INSERT INTO logs (host, facility, priority, level, tag, date, time,
    program, msg) VALUES ( '192.168.254.250', 'auth', 'notice',
'notice',
    '25', '2004-07-01', '15:26:28', 'DNS_NS25','DNS_NS25: NetScreen
    device_id=3DDNS_NS25  [No Name]system-notification-00257(traffic):
    start_time=3D\"2004-07-01 15:30:26\" duration=3D2 policy_id=3D0
service=3Ddns
    proto=3D17 src zone=3DTrust dst zone=3DUntrust action=3DPermit =
sent=3D99
    rcvd=3D274 src=3D192.168.254.2 dst=3D63.209.70.231 src_port=3D1116
dst_port=3D53
    src-xlated ip=3D12.28.143.203 port=3D1116
  =20
    /etc/syslog-ng/syslog-ng.conf

    destination d_mysql { pipe("/tmp/mysql.pipe" template("INSERT INTO
logs (host, facility, priority, level, tag,        date, time, program,
msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG',
'$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM','$MSG' )\n")
template-escape(no)); };
=20
    The problem obviously is with the msg field, at times the msg field
wouldn't get terminated with the=20
    Single quote that is required for the SQL INSERT syntax. I am sure
that atleast one of you may have=20
    already came across this problem. Is there a work around for this?

    Any ideas....let me know if you need more info to get me out of this
error. Thanks in advance.

    Thanks,=20
    Venkata Achanta