httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Dessent <br...@dessent.net>
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
version.

Brian

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message