logmonitor/etc/syslog-ng/templates/d_sql.template

22 lines
475 B
Text
Raw Permalink Normal View History

2021-01-28 07:10:11 -05:00
destination d_sql {
sql(
type(mysql)
host("SQL_HOST")
port("SQL_PORT")
username("SQL_USER")
password("SQL_PASSWORD")
database("SQL_DATABASE")
table("logs")
columns("host", "facility", "priority", "level", "tag", "fo", "program", "msg")
values("$HOST", "$FACILITY", "$PRIORITY", "$LEVEL", "$TAG","$YEAR-$MONTH-$DAY $HOUR:$MIN:$SEC", "$PROGRAM", "$MSG")
indexes("fo", "host")
);
};
log {
source(s_local);
source(s_network);
destination(d_sql);
};