[syslog-ng] Problems with syslog-ng and filters-

Ville Leinonen ville.leinonen at megata.vu
Tue Jul 12 08:49:43 CEST 2005


Hi all,

I have created 2 filters. There is check if there is link up/down text
in msg field. If its match then there comes N else there should be comes
N. My problem is now that i syslog-ng puts double in sql-table one is Y
and one is N. Any suggestion what is wrong? Here comes also
configuration.

source net { udp(ip("0.0.0.0") port(514)); };

filter f_link_downup { match(LINK-3-UPDOWN) or match(LINEPROTO-5-UPDOWN) or match(off-line) or match(on-line); };
filter f_others { not match(LINK-3-UPDOWN) or not match(LINEPROTO-5-UPDOWN) or not match(off-line) or not match(on-line); };

log { source(net); filter(f_link_downup); destination(d_mysql_downup); };
log { source(net); filter(f_others); destination(d_mysql_others); };

destination d_mysql_downup {
 pipe("/tmp/mysql.pipe" template("INSERT INTO logs (host, facility, priority, level, tag, date, time, program, msg, showdata)
 VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL','$TAG', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG', 'N' );\n")
 template-escape(yes));
};

destination d_mysql_others {
 pipe("/tmp/mysql.pipe" template("INSERT INTO logs (host, facility, priority, level, tag, date, time, program, msg, showdata)
 VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL','$TAG', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG', 'Y' );\n")
 template-escape(yes));
};



Br,

Ville Leinonen



More information about the syslog-ng mailing list