#!/usr/bin/perl # # usage: # cat access_log | this_script > access_log.without_spam # my @reject_referrers = ( '.*stories-site\.com$', '.*stories\.org$', '.*girls\.name$', '.*tits\.name$', '.*service\.name$', '.*hole\.name$', '.*shemale\.name$', '.*gang-bang\.name$', '.*movies\.us$', '.*videos\.us$', '.*xxx.*', '.*beast.*', '.*pussy.*', '.*fetish.*', '.*sex.*', '.*porn.*', '.*nudity.*', '.*cumfiesta.*', '.*hand-job.*', '.*handjob.*', '.*webcam.*', '.*hardcore.*', '.*asian.*', '.*anime.*' ); while (my $input = ) { $input =~ s/\r//; $input =~ s/\n//; my $matched = 0; if ($input =~ /^(.+) (.+) (.+) \[(.+)\] \"([^"]+)\" (\d+) (\d+) \"([^"]*)\" \"([^"]*)\"$/) { my $referrer = $8; foreach my $r (@reject_referrers) { $matched = 1 if ($referrer =~ /$r/); } } print "$input\n" if ($matched == 0); }