I need to keep certain system log entries in a database. I have installed and configured MySQL server and client. I have also installed the syslog-ng package. Then I configure the
file as seen below:
But when I start the service, syslog-ng complains:
I have looked for a solution on the Internet and they say I need install the syslog-ng package with some kind of option to enable writing to MySQL. Is there a way to customise installation options when using pkg? (If no, why not?) Or do I have to install it through ports?
Code:
/usr/local/etc/syslog-ng.conf
Code:
@version:3.6
@include "scl.conf"
source DEFAULT
{
network
(
ip(127.0.0.1)
port(5140)
transport("udp")
);
};
# DHCP
filter dhcpd_filter
{
program("dhcpd") and
message("DHCPACK on");
};
parser dhcpd_parser
{
csv-parser
(
columns("MSG.ACK","MSG.ON","MSG.IP","MSG.TO","MSG.MAC","MSG.HOSTNAME")
flags(escape-none, strip-whitespace)
delimiters(" ")
);
};
destination dhcp_sql
{
sql
(
type(mysql)
host("localhost") username("log_writer") password("0000")
database("log_db")
table("dhcp")
columns("logtime", "mac_address", "ip_address", "hostname")
values("$R_DATE", "${MSG.MAC}", "${MSG.IP}", "${MSG.HOSTNAME}")
);
};
log
{
source(DEFAULT);
filter(dhcpd_filter);
parser(dhcpd_parser);
destination(dhcpd_sql);
};
But when I start the service, syslog-ng complains:
Code:
Starting syslog_ng.
Error parsing destination, destination plugin sql not found in /usr/local/etc/syslog-ng.conf at line 43, column 3:
sql
^^^
syslog-ng documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
mailing list: https://lists.balabit.hu/mailman/listinfo/syslog-ng
/usr/local/etc/rc.d/syslog-ng: WARNING: failed to start syslog_ng
I have looked for a solution on the Internet and they say I need install the syslog-ng package with some kind of option to enable writing to MySQL. Is there a way to customise installation options when using pkg? (If no, why not?) Or do I have to install it through ports?