#use HTTP::Date qw(time2iso str2time time2iso time2isoz);
#my $CurrTime = (split / /,time2iso(time()))[0];
my %log;
#if ( $#ARGV < 1 ){
# print "please input your date!
";
# exit(-1);
# }
# $date= $ARGV[0];
# $ip_addr = $ARGV[1];
@file = glob "/data01/mysql/jrhdpt01-slow.log";
foreach $file (@file){
print "------file is $file-----------
";
open (LOG ,"<","$file");
while (<LOG>) {
chomp;
##正则条件匹配
if ($_ =~ /^#s*Time:s+(d{6}s*d{1,2})/){
#print "$1 is $1
";
$var= $1;
$log{$var}++;
}}
};
while(my($ip, $times) = each %log) {
print "$ip execute slow-sql times is $times
";
};