iptables logging on kubuntu with rsyslogd

From thelinuxwiki
Jump to: navigation, search

versions

kubuntu version 14

problem

iptables is logging to /var/log/syslog, but we want it logging to a separate file.


solution

  1. create /etc/rsyslog.d/iptables.conf file with the following contents
:msg, contains, "iptables" -/var/log/iptables.log
& ~
  1. restart rsyslogd
/etc/init.d/rsyslogd restart
  1. verify functionality (you might need to generate some traffic to the host)
# tail -f /var/log/iptables.log