httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Dessent <>
Subject Re: [users@httpd] Matching cmd.exe
Date Fri, 18 Jul 2003 01:34:41 GMT
Nigel Peck - MIS Web Design wrote:
> To avoid the overhead of sending the 404, clogging up the log file etc.

At the end of the day, anything at the server level (as opposed to just
null-routing at the firewall) is going to be about as expensive as the
default 404 action.  If you just want to clean up the logfiles
after-the-fact, here is a script I use that I call 'filtlog' which
removes such trash.

#!/usr/bin/perl -w

use Parse::AccessLogEntry;

my $p = Parse::AccessLogEntry::new();

while( <> ) {
  my $l = $p->parse( $_ );

  print if ($l->{file} !~ m!(/default\.ida\?N+) |
       (/(scripts|msadc|msdac|[cd]/winnt|_vti_bin|_vti_cnf|_mem_bin)) |
       (/cmd\.exe\?/c\+dir)!ix );

You could generalize this down to a single "grep -v -P" type command,
but I have some other exclusions in there that I've omitted from this


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message