]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Included Action::Syslog by default in config
authorMartin Holste <mcholste@gmail.com>
Sat, 21 Apr 2012 14:41:06 +0000 (09:41 -0500)
committerVictor Julien <victor@inliniac.net>
Mon, 23 Apr 2012 09:24:58 +0000 (11:24 +0200)
contrib/file_processor/README
contrib/file_processor/file_processor.conf
contrib/file_processor/file_processor.pl

index 740b946d8fb35c05f4424e348445223adfc8bad0..2dca715bac0fc231f8711ad9073926a9ae5d40be 100644 (file)
@@ -4,5 +4,5 @@ To create new plugins, use the existing modules as a guide.  Drop a new file wit
 
 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.
index a1170ab437cd7ce2a9acd19703eb03679f38dd06..839c0c3505d78065dee2215e2b8aabbb58797307 100644 (file)
@@ -3,7 +3,8 @@
        "debug_level": "INFO",
        #"virustotal_apikey": "xxx"
        "actions": {
-               "Action::Log": 1
+               "Action::Log": 1,
+               "Action::Syslog": 1
        },
        "processors": {
                "Processor::Anubis": 1,
index 49f97f8dcfcd041b4fcdb863e16703979b67ab8e..f9cce0222305d25b9c8a8450915c48e9cc58b38d 100644 (file)
@@ -50,13 +50,14 @@ sub process {
        #$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){
@@ -89,7 +90,8 @@ my $Conf = {
        logdir => '/tmp',
        debug_level => 'TRACE',
        actions => {
-               'Action::Log' => 1
+               'Action::Log' => 1,
+               'Action::Syslog' => 1,
        },
        processors => {
                'Processor::Anubis' => 1,