I noticed that there are data in the iptables log that I don't need, so I was wondering if it's possible to change some configuration so that the log has less information, thus reducing the log's size.

I would like log a write only once per IP during some times.


You can use the hashlimit match. Take a look on the options here.
In order to log once per source ip per hour, you would have, for example :

iptables -A INPUT -m hashlimit --hashlimit-upto 1/hour --hashlimit-mode srcip -j LOG

Basing on your needs, you can use the following modes : srcip, dstip, srcport, dstport and the following length : /sec, /minute, /hour, /day.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.