Catmandu::Importer::ApacheLog - Catmandu importer for importing log entries
This importer reads every entry in the log file, and put the log entries (status, rhost ..) into a record. The original line is stored in the attribute '_log'.
File to import. Can also be a string reference or a file handle. See L<Catmandu::Importer>
Fix to apply to every record. See L<Catmandu::Importer>
Array reference of formats By default ['combined','common'] For more information see L<Apache::Log::Parser>, and look for the option 'fast'.
#!/usr/bin/env perl use Catmandu::Importer::ApacheLog; use Data::Dumper; my $importer = Catmandu::Importer::ApacheLog->new( file => "/var/log/httpd/access_log" ); $importer->each(sub{ print Dumper(shift); }); #!/bin/bash catmandu convert ApacheLog --file access.log to YAML
Nicolas Franck C<< <nicolas.franck at ugent.be> >>
L<Catmandu>, L<Catmandu::Importer> , L<Apache::Log::Parser>
To install Catmandu::Importer::ApacheLog, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catmandu::Importer::ApacheLog
CPAN shell
perl -MCPAN -e shell install Catmandu::Importer::ApacheLog
For more information on module installation, please visit the detailed CPAN module installation guide.