Implementing quick excludes in Perl

#! /usr/local/bin/perl -w
# Routine to ignore “normal” log entries – after Marcus Ranum’s
# “artificial ignorance”
#
while (<>)
{
if (/.*popper\[.*: connect from /} { next }
elsif (/.*sshd\[.*log:.*accepted/} { next }
elsif (/.*telnetd\)[*.: connect from /} { next }
elsif (/.*sshd\[.* log: RSA key.*complete/) { next }
elsif (/.*sshd\[.* log: Generating.*key/) { next }
elsif (/.*sshd\[.* log: Closing connection/) { next }
elsif (/.*ftpd\[.*: connect from/) { next }
elseĀ {print}
}

Leave a Reply

Your email address will not be published. Required fields are marked *