[syslog-ng] Running ON INSERT UPDATE (MySQL)

Dukes Clayton Clayton.Dukes at HCAhealthcare.com
Fri Mar 17 16:26:46 CET 2006


Hii,
I'm trying to update a table when I do an insert, do I have the syntax
correct here?


destination db_mysql { pipe("/var/log/mysql.pipe"
template("INSERT INTO logs (host, facility, priority, level, datetime,
msg)
VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$YEAR-$MONTH-$DAY
$HOUR:$MIN:$SEC','$MSG' ) ON INSERT UPDATE NumRows SET
NumRowsLogs=NumRowsLogs+1;\n")
template-escape(yes)); };

TIA!
-Clayton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20060317/02ea5a5f/attachment.htm


More information about the syslog-ng mailing list