Running script on log rotation?

For some of my log files I would like to run a script when the logs are rotated with newsyslog. Those are logs that include IPs and I’d like to anonymize those when the rotation is happening. This I would have IPs for the day but on rotation I would like to remove the last two octets.
is that possible? If so, how?
 
Back
Top