[syslog-ng] syslog-ng with sql() command, cpu to 100%

Garry De Toffoli dtgarry at hotmail.com
Wed Oct 7 11:29:53 CEST 2009


I have tried to run syslog-ng in this way:

root at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20091007/cf0a2bee/attachment.htm 


More information about the syslog-ng mailing list