Im tinkering with my iptables logging at the moment. So I got my syslog to use another log file with tips from the web. basically you end up changing some chains and rules plus aan extra line in the /etc/syslog.conf
kern.warning /var/log/iptables.log
But I get a strange feeling with this. I know why you need to do it like this because iptables is a kernel thing. BUT I cant shake the feeling that something else that produces a kernel warning is also gonna log to this file? I cant really find a clear explanation about this. It just doesnt feel clean.. mayb its just my adminautism kickin in
thanks in advance Koen
You are correct about this. All Kernel warnings will now be logged to iptables.log. Unfortunately, there's no better way to do this with classic syslogd as it's only able to filter kernel messages via priority.
To get a better syslog filtering, you will have to use a different syslog service like
rsyslogd
. There's more information in this blogpost.