∗[0−9]∗[˙0−9]∗ iptables: " -/var/log/iptables.log & ~ line 1 and 3 are filters and log file locations, if they match the log is written to the specified log file. line 2 and 4 tell rsyslog "don't process future rules (if the one before matches), it's done for this log entry" Now the only thing left is to create a log rotation rule. Therefore create the file /etc/logrotate.d/iptables with this content: /var/log/iptables.log { rotate 7 daily missingok notifempty delaycompress compress postrotate invoke-rc.d rsyslog rotate > /dev/null iptables-save >> /var/log/iptables.log endscript }" />
∗[0−9]∗[˙0−9]∗ iptables: " -/var/log/iptables.log & ~ line 1 and 3 are filters and log file locations, if they match the log is written to the specified log file. line 2 and 4 tell rsyslog "don't process future rules (if the one before matches), it's done for this log entry" Now the only thing left is to create a log rotation rule. Therefore create the file /etc/logrotate.d/iptables with this content: /var/log/iptables.log { rotate 7 daily missingok notifempty delaycompress compress postrotate invoke-rc.d rsyslog rotate > /dev/null iptables-save >> /var/log/iptables.log endscript }" />
∗[0−9]∗[˙0−9]∗ iptables: " -/var/log/iptables.log & ~ line 1 and 3 are filters and log file locations, if they match the log is written to the specified log file. line 2 and 4 tell rsyslog "don't process future rules (if the one before matches), it's done for this log entry" Now the only thing left is to create a log rotation rule. Therefore create the file /etc/logrotate.d/iptables with this content: /var/log/iptables.log { rotate 7 daily missingok notifempty delaycompress compress postrotate invoke-rc.d rsyslog rotate > /dev/null iptables-save >> /var/log/iptables.log endscript }" />