The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Log::Analyze -

SYNOPSIS

default pattern(count up)

  use Log::Analyze;
  
  my $parser = Log::Analyze->new;
  
  #----------------
  # count 
  #----------------
  while(<LOG>){
      chomp $_;
      my @f = split(/\t/, $_);
      $parser->analyze([$f[1],$[2],$f[3]...], "count");
  }
  
  my $hash_ref  = $parser->tree;
  my $array_ref = $parser->matrix;

sum pattern(count up)

  #----------------
  # sum
  #----------------
  while(<LOG>){
      chomp $_;
      my @f = split(/\t/, $_);
      $parser->analyze([$f[1],$[2],$f[3]...], "sum" => $f[10]);
  }

custom pattern(set coderef)

  #----------------
  # custom  
  #----------------
  while(<LOG>){
      chomp $_;
      my @f = split(/\t/, $_);
      $parser->analyze([$f[1],$[2],$f[3]...], $coderef => $argsref);
  }
  
  $code = sub {
      my $tree_data = shift;
      my $args_ref  = shift;
      ....
  };

DESCRIPTION

Log::Analyze is simple log analysis module.

Usually, a task of log analysis is simply "count" the records, or "sum" the value of a particular field in every log records.

Furthermore, you sometimes expect more difficult practice that become your custom code.

It makes these tasks very simple.

METHODS

new()

analyze()

tree()

matrix()

AUTHOR

takeshi miki <miki@cpan.org>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO