In an iptables log, can I get rid of IN, LEN, TOS etc?

Posted on

In an iptables log, can I get rid of IN, LEN, TOS etc? – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, security, firewall, , .

In my iptables log, I get very repetitive and hard to read data like that:


I am using my Ubuntu machine as a web server.
Which one of these can I eliminate of my iptables log? Which ones are useful for security and monitoring?

How can I disable that unnecessary data?

Solution :

You could always use Perl to extract the information you’re interested in from the logs, e.g.:

perl -ne 'print "$1 $2 $3n" if /(SRC=S+).*(DST=S+).*(DPT=S+)/'

As others have already said it’s not advisable to omit fields from the logs, because you may need that information at some point.

Leave a Reply

Your email address will not be published.