I have an apache / nginx whatever webserver which logs client ip addresses to the access logs. Now these log files are rotated via logrotate.
I want to keep the IP addresses for some days, then - after 7 days, i want to remove the ips from the log files for privacy reasons (mostly dictated by german law)
using mod_removeip or something like that doesn't work because I need to filter some requests based on their IP addresses.
Is there any 'standard' way how to do that - maybe even with logrotate?
EDIT
i just found this script http://www.zendas.de/technik/sicherheit/apache/index.html but it depends on the ability to pipe all logging trough the script in real-time. i'm not really sure about the performance implication of this approach.
Also, this only works for the 'front-end' server logs, not the application server logs