CA BD NY
  • Categories

  • Recent Posts

  • RSS MySQL Hacker

  • RSS CentOS Hacker

  • RSS Editor's Lists

    • An error has occurred; the feed is probably down. Try again later.
  • Meta

  • Archive for the Log Management Category


    Quick and Dirty Apache Bandwidth Report Hack in Perl

    Published March 2nd, 2010

    Google Analtyics, Quantcast etc are nice for marketing types. We needed a quick-and-dirty bandwidth report based on Apache access log. So whipped out the following perl script to do just that.

    #!/usr/bin/env perl
    use Time::DaysInMonth;
    $|++;

    my %months = (’Jan’ => 1,
    ‘Feb’ => 2,
    ‘Mar’ => 3,
    ‘Apr’ => 4,
    ‘May’ => 5,
    ‘Jun’ => 6,
    ‘Jul’ => 7,
    ‘Aug’ => 8,
    ‘Sep’ => 9,
    ‘Oct’ => [...]

    Quick and Dirty Apache Log Analyzer to Find Top-100 IP Visits

    Published January 16th, 2010

    We do not run local log analysis program since most customers rely on off-site Google Analytics. So we find ourselves often writing on-the-fly awk scripts to find the top-100 or top-1000 IP visitors from time to time when debugging site performance issues. Who hasn’t found their sites slow thanks to crawlers jamming the site?
    So to [...]

    Writing a Custom Apache Log File Using a PHP Script in Real Time

    Published December 14th, 2008

    How to Write a Custom Apache Log File Using a PHP Script in Real Time

    Automatically Rotating Logs Using Cronolog

    Published November 5th, 2008

    Automatically rotating Apache logs using cronolog utility.

    Filtering Apache Log To Save Disk Space

    Published November 3rd, 2008

    Problem Statement
    Once a site has been in production for awhile, there is hardly any point in logging every hit for images, css, JavaScript, favicon.ico, etc. They simply are not interesting and waste not only disk space but also valuable I/O time. Here we will show you how you can avoid logging unnecessary requests and have [...]