Intro to Apache - ApacheCon 2005
Log file reporting and Perl
  • Perl is, after all, the Practical Extraction and Report Language

  • There's a nice module called Apache::ParseLogs which gives an OO interface to parsing Apache log files.

  • And, if you're particularly daring, you can log directly to a Perl program (or other process)

    
        CustomLog "|/usr/local/bin/logprocess.pl" common
    
      

  • logprocess.pl would look like ...

    
        #!/usr/bin/perl
    
      
    
        while (my $log = <STDIN>) {
            DoSomethingWith($log);
        }
    
      

  • Where sub DoSomethingWith( ) logs to a database, or writes to a file, or emails you summary data, or something.

Index
Back to Log file statistics
Forward to Error logs

ApacheCon 2005 : Intro to Apache - Slide #141 of 164