INSTALLATION
You will need a few Perl modules to get going. I recommend using the excellent cpanm utility which can be installed by typing "cpan App::cpanminus." After cpanm is installed, you can install everything in one command like this:
-cpanm Moose Module::Pluggable Log::Log4perl Config::JSON File::Tail LWP::UserAgent
+cpanm Moose Module::Pluggable Log::Log4perl Config::JSON File::Tail LWP::UserAgent Sys::Syslog
Alternatively, you may wish to install using your operating system's package manager, though that may not use the latest code for these modules.
#$self->log->debug('got line ' . $line);
eval {
my $data = $self->json->decode($line);
- return unless $data->{md5};
$data->{processors} = {};
- foreach my $processor_plugin ($self->processors){
- next unless exists $self->conf->{processors}->{$processor_plugin};
- my $processor = $processor_plugin->new(conf => $self->conf, log => $self->log, md5 => $data->{md5});
- $self->log->debug('processing with plugin ' . $processor->description);
- $data->{processors}->{ $processor->name } = $processor->process();
+ if($data->{md5}){
+ foreach my $processor_plugin ($self->processors){
+ next unless exists $self->conf->{processors}->{$processor_plugin};
+ my $processor = $processor_plugin->new(conf => $self->conf, log => $self->log, md5 => $data->{md5});
+ $self->log->debug('processing with plugin ' . $processor->description);
+ $data->{processors}->{ $processor->name } = $processor->process();
+ }
}
#$self->log->debug('data: ' . Dumper($data));
foreach my $action_plugin ($self->actions){
logdir => '/tmp',
debug_level => 'TRACE',
actions => {
- 'Action::Log' => 1
+ 'Action::Log' => 1,
+ 'Action::Syslog' => 1,
},
processors => {
'Processor::Anubis' => 1,