+@version: 3.0
#
# Configuration file for syslog-ng under Debian.
# Customized for sarava.org, originally developed by riseup.net
chain_hostnames(0);
time_reopen(10);
time_reap(360);
- sync(0);
+ flush_lines(0);
log_fifo_size(2048);
create_dirs(yes);
group(adm);
internal();
unix-stream("/dev/log");
<% if (log_kernel_msgs == true) -%>
- file("/proc/kmsg" log_prefix("kernel: "));
+ file("/proc/kmsg" program_override("kernel"));
<% end -%>
};
destination df_facility_dot_crit { file("/var/log/$FACILITY.crit"); };
############################################################
-## generic filters
+## generic filters and rewrites
# strip IP addresses
-filter f_strip { strip(ips); };
+# regexp thanks to micah and dsyslog
+rewrite r_strip {subst("(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])([\\.\\-](25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])){3}", "0.0.0.0", value("MESSAGE"), flags("global"));};
filter f_at_least_info { level(info..emerg); };
filter f_at_least_notice { level(notice..emerg); };
log {
source(s_all);
filter(f_auth);
- filter(f_strip);
+ rewrite(r_strip);
destination(df_auth);
};
log {
source(s_all);
filter(f_daemon);
- filter(f_strip);
+ rewrite(r_strip);
destination(df_daemon);
};
log {
source(s_all);
filter(f_kern);
- filter(f_strip);
+ rewrite(r_strip);
destination(df_kern);
};
log {
source(s_all);
filter(f_user);
- filter(f_strip);
+ rewrite(r_strip);
destination(df_user);
};
log {
source(s_all);
filter(f_sympa);
- filter(f_strip);
+ rewrite(r_strip);
destination(d_sympa);
flags(final);
};
log {
source(s_all);
filter(f_wwsympa);
- filter(f_strip);
+ rewrite(r_strip);
destination(d_wwsympa);
flags(final);
};
log {
source(s_all);
filter(f_ldap);
- filter(f_strip);
+ rewrite(r_strip);
destination(d_ldap);
flags(final);
};
log {
source(s_all);
filter(f_postfix);
- filter(f_strip);
+ rewrite(r_strip);
destination(d_postfix);
flags(final);
};
log {
source(s_all);
filter(f_courier);
- filter(f_strip);
+ rewrite(r_strip);
destination(d_courier);
flags(final);
};
log {
source(s_all);
filter(f_maildrop);
- filter(f_strip);
+ rewrite(r_strip);
destination(d_courier);
flags(final);
};
log {
source(s_all);
filter(f_mail);
- filter(f_strip);
+ rewrite(r_strip);
destination(df_mail);
};
## messages.log
filter f_messages {
- level(debug,info,notice)
- and not facility(auth,authpriv,daemon,mail,user,kern);
+ level(debug,info,notice)
+ and not facility(auth,authpriv,daemon,mail,user,kern);
};
destination df_messages { file("/var/log/messages.log"); };
log {
source(s_all);
filter(f_messages);
- filter(f_strip);
+ rewrite(r_strip);
destination(df_messages);
};
log {
source(s_all);
filter(f_errors);
- filter(f_strip);
+ rewrite(r_strip);
destination(df_errors);
};
log {
source(s_all);
filter(f_emerg);
- filter(f_strip);
+ rewrite(r_strip);
destination(du_all);
};
log {
source(s_all);
filter(f_xconsole);
- filter(f_strip);
+ rewrite(r_strip);
destination(dp_xconsole);
};