* Perl question.
@ 1997-03-05 1:40 Pam Woods, Systems Manager
0 siblings, 0 replies; only message in thread
From: Pam Woods, Systems Manager @ 1997-03-05 1:40 UTC (permalink / raw)
To: tru64-unix-managers
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 (@users) {$count3{$_}++;
}
for (sort keys %count3) {
printf "\t\t%2s %5d\n",$_, $count3{$_};
}
________
Pam Woods - axsymgr@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...
*****************************************************************
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1997-03-05 1:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-03-05 1:40 Perl question Pam Woods, Systems Manager
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox