I'm using Logwatch on a machine running a firewall. Every day I get an email full of entries like the following:
From 123.123.123.10 - 28087 packets
To 123.123.123.1 - 2 packets
Service: http (tcp/80) (Firewall Allow) - 2 packets
To 123.123.123.2 - 1 packet
Service: http (tcp/80) (Firewall Allow) - 1 packet
To 123.123.123.3 - 7 packets
Service: https (tcp/443) (Firewall Allow) - 7 packets
From 123.123.123.11 - 28087 packets
To 123.123.123.1 - 2 packets
Service: http (tcp/80) (Firewall Allow) - 2 packets
To 123.123.123.2 - 1 packet
Service: http (tcp/80) (Firewall Allow) - 1 packet
To 123.123.123.3 - 7 packets
Service: https (tcp/443) (Firewall Allow) - 7 packets
I would like to put an entry in my ignore.conf file that skips all the information for a specific system or subnet. Since the ignore.conf entries are just Perl-style regular expressions, if I put
^ From 123\.123\.123\.10
in the file, the matching "From" line is deleted, but all the other lines remain. My question is, can I construct a single regex that will match not only the "From" line, but all the lines that follow it, until the next line beginning with "^ From" occurs? I know you can do this with sed, but I'm not sure if it's possible with just a regex in ignore.conf. Thanks in advance to all who respond.