blob: 6b7c31a152d90a037b20769db3c3b32f81f02517 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package Action::Syslog;
use Moose;
extends 'Processor';
use Sys::Syslog qw(:standard :macros);
our $Program = 'suricata_file';
our $Facility = LOG_LOCAL0;
has 'data' => (is => 'rw', isa => 'HashRef', required => 1);
sub name { 'syslog' }
sub description { 'Log to local syslog' }
sub perform {
my $self = shift;
openlog($Program, undef, $Facility);
syslog(LOG_INFO, $self->json->encode($self->data));
closelog;
}
1
|