Log::Analyze -
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 #---------------- while(<LOG>){ chomp $_; my @f = split(/\t/, $_); $parser->analyze([$f[1],$[2],$f[3]...], "sum" => $f[10]); }
#---------------- # 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; .... };
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.
takeshi miki <miki@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Log::Analyze, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Analyze
CPAN shell
perl -MCPAN -e shell install Log::Analyze
For more information on module installation, please visit the detailed CPAN module installation guide.