syslog-ng with sql() command, cpu to 100%
I have tried to run syslog-ng in this way: root@syslog-srv904:/opt/syslog-ng/sbin# ./syslog-ng -f /opt/syslog-ng/etc/syslog-ng.conf without any option of debug; on syslog-ng.conf there is: destination d_mysql { sql(type(mysql) host("127.0.0.1") username("syslogadmin") password("syslogadmin") database("syslog") table("logs") columns("host", "facility", "priority", "level", "tag", "datetime", "program", "msg") values("$HOST", "$FACILITY", "$PRIORITY", "$LEVEL", "$TAG", "$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC", "$PROGRAM", "$MSG") indexes()); }; MySql is configured to accept the configuration from network, so the host("127.0.0.1") username("syslogadmin") password("syslogadmin") is correct; and the CPU run to 100% and doesn't write anything to dbase; but if use this configuration destination d_mysql { program("/usr/bin/mysql -usyslogadmin -psyslogadmin syslog" template("INSERT INTO logs (host, facility, priority, level, tag, datetime, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n") template-escape(yes)); }; run OK; it seems that the sql() statement go in loop; where is the error? Someone can send a configuration that run OK? Thank you. _________________________________________________________________ Scopri tutti i servizi Windows Live, guarda i video http://www.windowslive.it/videoGallery.aspx
Hi,
it seems that the sql() statement go in loop;
where is the error?
Could you attach strace on syslog-ng, preferably restarting syslog-ng under strace? Something like strace -ff -tt -s 128 -p <PID of running syslog-ng> -o syslogstrace In the resulting files you could either find the cause of the problem, or you could send us some details about what's going on. Regards, Sandor
participants (2)
-
Garry De Toffoli
-
Sandor Geller