[syslog-ng] sql-driver and "ON duplicate KEY UPDATE"

system at ra-schaal.de system at ra-schaal.de
Wed Jan 2 10:35:25 CET 2013


Hi all,

is it possible to perform an "ON duplicate KEY UPDATE" with the
sql-driver for a mysql-database?

At the moment I use

destination d_sql {
program("/usr/bin/mysql -uUSER -pPASSWORD DATABASE"
template("INSERT INTO TABLE VALUES (inet_aton('${.apache.client_ip}')
,${.apache.content_length},CURRENT_TIMESTAMP,1 ) ON duplicate KEY UPDATE
bytes=bytes+${.apache.content_length}, hits=hits+1;\n")
template-escape(yes));
};

without any problems. By using this destination, syslog-ng can´t use the
sql-driver. I`m not sure if there is any difference between sql-driver
and the destination above.

regards
Florian


More information about the syslog-ng mailing list