]> gitweb.fluxo.info Git - puppet-syslog-ng.git/commitdiff
Using squeezy config for lucid
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 11 May 2011 15:48:46 +0000 (12:48 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 11 May 2011 15:48:46 +0000 (12:48 -0300)
templates/syslog-ng.conf_lucid.erb

index 33e7e3668864065847e6f2943e905cbbca7de304..455bda59367a49387db59d6aa83978478d12ebbb 100644 (file)
@@ -1,3 +1,4 @@
+@version: 3.0
 #
 # Configuration file for syslog-ng under Debian.
 # Customized for sarava.org, originally developed by riseup.net
@@ -15,7 +16,7 @@ options {
     chain_hostnames(0);
     time_reopen(10);
     time_reap(360);
-    sync(0);
+    flush_lines(0);
     log_fifo_size(2048);
     create_dirs(yes);
     group(adm);
@@ -31,7 +32,7 @@ source s_all {
     internal();
     unix-stream("/dev/log");
 <% if (log_kernel_msgs == true) -%>
-    file("/proc/kmsg" log_prefix("kernel: "));
+    file("/proc/kmsg" program_override("kernel"));
 <% end -%>
 };
 
@@ -45,10 +46,11 @@ destination df_facility_dot_err    { file("/var/log/$FACILITY.err");    };
 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); };
@@ -64,7 +66,7 @@ destination df_auth { file("/var/log/auth.log"); };
 log {
     source(s_all);
     filter(f_auth);
-    filter(f_strip);
+    rewrite(r_strip);
     destination(df_auth);
 };
 
@@ -76,7 +78,7 @@ destination df_daemon { file("/var/log/daemon.log"); };
 log {
     source(s_all);
     filter(f_daemon);
-    filter(f_strip);
+    rewrite(r_strip);
     destination(df_daemon);
 };
 
@@ -88,7 +90,7 @@ destination df_kern { file("/var/log/kern.log"); };
 log {
     source(s_all);
     filter(f_kern);
-    filter(f_strip);
+    rewrite(r_strip);
     destination(df_kern);
 };
 
@@ -100,7 +102,7 @@ destination df_user { file("/var/log/user.log"); };
 log {
     source(s_all);
     filter(f_user);
-    filter(f_strip);
+    rewrite(r_strip);
     destination(df_user);
 };
 
@@ -112,7 +114,7 @@ destination d_sympa { file("/var/log/sympa.log"); };
 log {
     source(s_all);
     filter(f_sympa);
-    filter(f_strip);
+    rewrite(r_strip);
     destination(d_sympa);
     flags(final);
 };
@@ -125,7 +127,7 @@ destination d_wwsympa { file("/var/log/wwsympa.log"); };
 log {
     source(s_all);
     filter(f_wwsympa);
-    filter(f_strip);
+    rewrite(r_strip);
     destination(d_wwsympa);
     flags(final);
 };
@@ -138,7 +140,7 @@ destination d_ldap { file("/var/log/ldap.log"); };
 log {
     source(s_all);
     filter(f_ldap);
-    filter(f_strip);
+    rewrite(r_strip);
     destination(d_ldap);
     flags(final);
 };
@@ -153,7 +155,7 @@ destination d_postfix { file("/var/log/postfix.log"); };
 log {
     source(s_all);
     filter(f_postfix);
-    filter(f_strip);
+    rewrite(r_strip);
     destination(d_postfix);
     flags(final);
 };
@@ -166,7 +168,7 @@ destination d_courier { file("/var/log/courier.log"); };
 log {
     source(s_all);
     filter(f_courier);
-    filter(f_strip);
+    rewrite(r_strip);
     destination(d_courier);
     flags(final);
 };
@@ -179,7 +181,7 @@ destination d_maildrop { file("/var/log/maildrop.log"); };
 log {
     source(s_all);
     filter(f_maildrop);
-    filter(f_strip);
+    rewrite(r_strip);
     destination(d_courier);
     flags(final);
 };
@@ -193,7 +195,7 @@ destination df_mail { file("/var/log/mail.log"); };
 log {
     source(s_all);
     filter(f_mail);
-    filter(f_strip);
+    rewrite(r_strip);
     destination(df_mail);
 };
 
@@ -201,14 +203,14 @@ log {
 ## 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);
 };
 
@@ -223,7 +225,7 @@ destination df_errors { file("/var/log/errors.log"); };
 log {
     source(s_all);
     filter(f_errors);
-    filter(f_strip);
+    rewrite(r_strip);
     destination(df_errors);
 };
 
@@ -235,7 +237,7 @@ destination du_all { usertty("*"); };
 log {
     source(s_all);
     filter(f_emerg);
-    filter(f_strip);
+    rewrite(r_strip);
     destination(du_all);
 };
 
@@ -252,7 +254,7 @@ destination dp_xconsole { pipe("/dev/xconsole"); };
 log {
     source(s_all);
     filter(f_xconsole);
-    filter(f_strip);
+    rewrite(r_strip);
     destination(dp_xconsole);
 };