#! /opt/bin/perl
# ________________________________________________________________
# /\ /\ The Web Developer's Virtual Library
# -{-<*>-}- World-Wide Web
# __\/_\/_________________________________________________________
# Author : Lucy Richmond
# Purpose : Read the access log and create a listing of the 404s
# with a referring page within our site
# Usage : find_error.pl
# Comment : The input file (access_log) is a standard Unix log file.
# The output file (cur_404.log) is of the form:
# bad URL (tab) calling URL
# Disclaimer: This software is provided freely on the understanding
# that the Author will not be held responsible for any
# problems arising from it's use, and that there is no support.
# ________________________________________________________________
open (IN, "cur_404.log")||die$!;
while () {
($who, $j, $j, $datime, $TZ, $method, $URL, $protoc, $status,
$bytes, $refer, $browser)
= split ;
next if !($status =~ /404/);
if (($refer =~ /wdvl.internet.com/i) or
($refer =~ /stars.com/i) or
($refer =~ /wdvl.com/i)) {
print OUT "$URL $refer\n" if ($URL =~ /html/) ;
}
}