I have a pop3 logfile of usernames by hour,min, sec.
I want to do a count by hour to see how many times that specific user
occurs (to see if someone has their client set for grabbing mail
less than every 10 mins.)
so I want to determine who's
logged in over xx amount of times within any given hour.
does anyone have a clue how to do this in perl?
I've come close as I can count the number of occurrences
for user1 for the whole file, but not by hour.
So this gives me the count by username, but how do I
then determine by hour by username the total?
while (<infile>){
#!/usr/bin/perl
# Use sysuaf mc authorize list/brief [123,*] to generate sysuaf_all.lis
# and convert it into a umod username only list for batch run later.
#
#
open(INFILE,"<pop3b.in");
open(OUTFILE,">pop3b.out");
print OUTFILE "People who have multiple occurrances: \n";
while(<INFILE>){
($dates,$time,$p3,$p4,$p5,$p6,$p7,$username)
= split(' ',$_);
($hour,$min,$sec) = split(':',$time);
$users[$#users+1]= $username;
} #endofwhile
for (_at_users) {$count3{$_}++;
}
for (sort keys %count3) {
printf "\t\t%2s %5d\n",$_, $count3{$_};
}
________
Pam Woods - axsymgr_at_uaa.alaska.edu
**** POP Users (Eudora/Netscape, etc.) **************************
Are you a DISK hog? If you haven't checked lately, please interactively
log in and be sure to clean up any old files.
Thanks for keeping our Disks Clean...
*****************************************************************
Received on Wed Mar 05 1997 - 02:57:04 NZDT