# Very basic config to accept logging from other machines into MySQL. Use # http://northernmost.org/files/fifo2mysql.sh to get the data from the pipe # into MySQL # # Could really get away with it with one filter, but hey, it's extensible :-) # # Erik Ljungstrom 07/10/07 # http://northernmost.org options { dir_perm(0755); perm(0644); chain_hostnames(no); use_dns(yes); keep_hostname(yes); }; source local { unix-stream("/dev/log"); # udp(ip(0.0.0.0) port(514)); internal(); }; #source src { unix-dgram("/dev/log"); internal(); }; source net { udp(ip(0.0.0.0) port(514)); }; # REMOTE destination d_mysql { pipe("/tmp/mysql.pipe" template("INSERT INTO logs (host, facility, priority, level, tag, date, time, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL','$TAG', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n") template-escape(yes)); }; filter f_8 { level(emerg); }; filter f_9 { level(notice); }; filter f_10 { level(warn); }; filter f_11 { level(crit); }; filter f_12 { level(debug); }; filter f_13 { level(info); }; log { source(net); filter(f_8); destination(d_mysql); }; log { source(net); filter(f_9); destination(d_mysql); }; log { source(net); filter(f_10); destination(d_mysql); }; log { source(net); filter(f_11); destination(d_mysql); }; log { source(net); filter(f_12); destination(d_mysql); }; log { source(net); filter(f_13); destination(d_mysql); };