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.
Hai tante foto? Organizzale con Windows Live