Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: counting yesterdays hits in a logfile

by space_monk (Chaplain)
on Nov 13, 2012 at 05:10 UTC ( #1003552=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use POSIX qw(strftime);
    
    $time= localtime(time-(24*60*60));
    $yesterday = strftime( '%d/%m/%y', $time);
    
  2. or download this
    `grep "$yesterday" logfile.log | wc -l`
    
  3. or download this
    open(LOGFILE,"<", "access.log")or die"Could not open log file.";
    my @logfile = <LOGFILE>
    my $hits = grep /$yesterday/, @logfile;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003552]
help
Chatterbox?
[erix]: heh, you can record your tunes now, I hadn't seen that before
[erix]: and my solfège is a little rusty too
[stonecolddevin]: damn where's a working cblast? looks like several of them are out of commission
[erix]: Tanktalus home node has one
[stonecolddevin]: erix thanks mate
[stonecolddevin]: also lol @ "I stomped a crap"
[stonecolddevin]: Disciplus i was just amazed he's returned after the thorough stomp that BrowserUk and several other monks gave him for spreading crap info

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2017-06-22 20:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (529 votes). Check out past polls.