home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet 1996 World Exposition
/
park.org.s3.amazonaws.com.7z
/
park.org.s3.amazonaws.com
/
Japan
/
LOGS
/
stat.pl
< prev
Wrap
Perl Script
|
2017-09-21
|
805b
|
35 lines
#!/usr/local/bin/perl
open(AWHTML, "$ARGV[0]") || die "open" ;
@datestr = split(/\./, $ARGV[0]) ;
$date = $datestr[0] ;
while (<AWHTML>) {
chop ;
if (m#Avg Accesses/Hour[^0-9]+([0-9\.]+)#) {
$avgacc = $1 ;
} elsif (m#Max Accesses/Hour[^0-9]+([0-9\.]+)#) {
$maxacc = $1 ;
} elsif (m#Min Accesses/Hour[^0-9]+([0-9\.]+)#) {
$minacc = $1 ;
} elsif (m#Accesses/Day[^0-9]+([0-9\.]+)#) {
$totacc = $1 ;
} else {
if (m#<B>([0-9\.]+)</B> unique host#) {
$tothosts = $1 ;
}
if (m#<B>([0-9\.]+)</B> pages related#) {
$avgpages = $1 ;
}
if (m#total of <B>([0-9\.]+)</B> hits and <B>([0-9\.]+)</B> errors#) {
$tothits = $1 ;
$toterrs = $2 ;
}
}
}
print "$date totacc=$totacc tothosts=$tothosts tothits=$tothits" ;
print " maxacc=$maxacc minacc=$minacc toterrs=$toterrs\n" ;