sql-driver and "ON duplicate KEY UPDATE"
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
"system@ra-schaal.de" <system@ra-schaal.de> writes:
is it possible to perform an "ON duplicate KEY UPDATE" with the sql-driver for a mysql-database?
Not currently, no. There are plans to change that, however, and allow for "ON DUPLICATE KEY UPDATE" aswell, but that's going to take a while.
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.
There's quite a lot of difference, but for your use-case, the program destination is a better fit at this time. -- |8]
participants (2)
-
Gergely Nagy
-
system@ra-schaal.de