Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: counting yesterdays hits in a logfile

by Kenosis (Priest)
on Nov 13, 2012 at 03:48 UTC ( [id://1003549]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    217.0.22.3 - - [10/Apr/2007:10:58:27 +0300] "GET / HTTP/1.1" 200 3700
    217.0.22.3 - - [10/Apr/2007:10:58:34 +0300] "GET /unix_sysadmin.html H
    +TTP/1.1" 200 3880
    217.0.22.3 - - [10/Apr/2007:10:58:45 +0300] "GET /talks/Fundamentals/r
    +ead-excel-file.html HTTP/1.1" 404 31
    
  2. or download this
    66.249.65.107 - - [11/Nov/2012:19:33:01 -0400] "GET /support.html HTTP
    +/1.1" 200 11179
    111.111.111.111 - - [11/Nov/2012:19:33:01 -0400] "GET / HTTP/1.1" 200 
    +10801
    
  3. or download this
    my $mergedYesterday = join '/', ( split ' ', $yesterday )[ 2, 1, 4 ];
              ^                 ^                     ^        ^  ^  ^ 
    ...
              |                 |                     + - Sun Nov 11 19:31
    +:46 2012
              |                 + - Use same delimiter as in log records
              + - 11/Nov/2012
    
  4. or download this
    /\[([^:]+)/;
      ^   ^
      |   |
      |   + - Capture everything up to the first colon, e.g., 11/Nov/2012
      + - Anchor at left bracket
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1003549]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-16 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found