Skip to content

Instantly share code, notes, and snippets.

@darwin
Last active February 28, 2017 08:00
Show Gist options
  • Select an option

  • Save darwin/eb1e2c66caed2fa64cefdc6f3a213414 to your computer and use it in GitHub Desktop.

Select an option

Save darwin/eb1e2c66caed2fa64cefdc6f3a213414 to your computer and use it in GitHub Desktop.
diff --git a/syslog-ng.conf b/syslog-ng.conf
index 0836d72..b47f605 100644
--- a/syslog-ng.conf
+++ b/syslog-ng.conf
@@ -21,15 +21,35 @@ filter f_turris_iptables {
not match(".*turris[^:]*: .*" value(MESSAGE)) or not level(debug);
};
+filter f_not_cron {
+ not program(".*cron.*");
+};
+
+filter f_cron {
+ program(".*cron.*");
+};
+
destination messages {
file("/var/log/messages" suppress(5) template("${ISODATE} ${PRIORITY} ${PROGRAM}[${PID}]: ${MSGONLY}\n") log_fifo_size(256));
};
+destination cron {
+ file("/var/log/cron" suppress(5) template("${ISODATE} ${PRIORITY} ${PROGRAM}[${PID}]: ${MSGONLY}\n") log_fifo_size(256));
+};
+
log {
source(src);
source(kernel);
filter(f_turris_iptables);
+ filter(f_not_cron);
destination(messages);
};
+log {
+ source(src);
+ source(kernel);
+ filter(f_cron);
+ destination(cron);
+};
+
include "/etc/syslog-ng.d/";
@JimmyS83
Copy link

Hi and thanks for the idea. It would be good also add patch for /etc/logrotate to rotate /var/log/cron also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment