I am trying to configure syslog-ng to write to mysql. I have already installed mysql and created the database and tables.

When I am enabling the syslog-ng to mysql using the following script in syslog-ng.conf , I get a parse error when staring syslog-ng

 

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(yes));

};

log { source(net); destination(d_mysql);

};

 

Best regards

Deepu