Here you go... the start or example of one :)
#!/usr/bin/perl # v0.1 April 18 2001 # dennis@durrow.com # Read apache log files # and tell me unique visits per day # and tell me the most popular page open(LOG_FILE,"/var/log/httpd/access_log") || die "Can't open"; $totalsize = 0; $count_not_found = 0; $count_unique = 0; $countrtget = 0; $countrtpost = 0; $countrtunknown = 0; $counthttp1 = 0; $counthttp11 = 0; $counthttpunknown = 0; $countsearchengine = 0; while($line = <LOG_FILE>) { chop($line); $count++; #break apart into the categories ($ip, $dash1, $dash2, $date, $tzoffset, $requesttype, $url, $http_ +type, $status, $size) = split(/ /,$line); print "$ip $url\n"; if($url eq "/robots.txt") { $countsearchengine++; } if($count < 2) { $start_date = $date; } if($status eq "404") { $count_not_found++; } if($requesttype eq "\"GET") { $countrtget++; } elsif($requesttype eq "\"POST") { $countrtpost++; } else { $countrtunknown++; } if($http_type eq "HTTP/1.0\"") { $counthttp1++; } elsif($http_type eq "HTTP/1.1\"") { $counthttp11++; } else { $counthttpunknown++; } $totalsize += $size; }; print "\nAccess log Results\n"; print "=====================\n"; print "Log Start: $start_date\n"; print "Log End: $date\n"; print "# of possible web crawlers: $countsearchengine\n"; print "# of unique hits: $count_unique\n"; print "# of get request types: $countrtget\n"; print "# of post request types: $countrtpost\n"; print "# of unknown request types: $countrtunknown\n"; print "# of 404 errors: $count_not_found\n"; print "# of Requests: $count\n"; print "# of bytes transferred: $totalsize\n"; print "# of 1.0 HTTP Request Types: $counthttp1\n"; print "# of 1.1 HTTP Request Types: $counthttp11\n"; print "# of unknown HTTP Request Types: $counthttpunknown\n";

Edit by tye to change PRE to CODE tags


In reply to Re: site statistics by Anonymous Monk
in thread site statistics by Baz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.