Destination MySQL for Syslog-ng 2.0.x
Hi, How can I collect the logs in MySQL db with syslog-ng 2.0.x? There is a destination 'sql' in syslog-ng 3+, but how can I do it with 2.0? Thanks and regards, Hidayath
Hi, in 2.0.x, the sql() destination was available only in the Premium Edition. In the open source edition it was released in 3.0 (or something like that). You can either upgrade to syslog-ng OSE 3.x, or use a program()/pipe() destination and load the messages to SQL using an external script. Regards, Robert On 03/11/2011 11:22 AM, Hidayath Basha wrote:
Hi, How can I collect the logs in MySQL db with syslog-ng 2.0.x? There is a destination 'sql' in syslog-ng 3+, but how can I do it with 2.0? Thanks and regards, *Hidayath*
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.campin.net/syslog-ng/faq.html
Fekete Robert <frobert@balabit.hu> wrote:
in 2.0.x, the sql() destination was available only in the Premium Edition. In the open source edition it was released in 3.0 (or something like that). You can either upgrade to syslog-ng OSE 3.x, or use a program()/pipe() destination and load the messages to SQL using an external script.
A postgresql example I use is: ---- destination d_sql_mac2addr { # program("sh -c 'PGPASSFILE=/etc/syslog-ng/pgpass psql --no-readline --quiet --no-password --host=sql.example.com --log-file=/tmp/sql.log DATABASE USERNAME > /dev/null 2> /dev/null'" program("sh -c 'PGPASSFILE=/etc/syslog-ng/pgpass psql --no-readline --quiet --no-password --host=sql.example.com DATABASE USERNAME > /dev/null 2> /dev/null'" template("SELECT record_addr('$ISODATE', '${MAC2ADDR.MAC}', '${MAC2ADDR.ADDR}');\n")); }; ---- Obviously the OP will need to fix it for mysql rather than psql plus no doubt they will want an alternative template :) Cheers -- Alexander Clouter .sigmonster says: Tomorrow, you can be anywhere.
participants (3)
-
Alexander Clouter
-
Fekete Robert
-
Hidayath Basha