Parse-Syslog-Line
view release on metacpan or search on metacpan
lib/Parse/Syslog/Line.pm view on Meta::CPAN
# ABSTRACT: Simple syslog line parser
package Parse::Syslog::Line;
use v5.16;
use warnings;
use Carp;
use Const::Fast;
use English qw(-no_match_vars);
use Exporter;
use Hash::Merge::Simple qw( dclone_merge );
use JSON::MaybeXS qw( decode_json );
use Module::Load qw( load );
use Module::Loaded qw( is_loaded );
use POSIX qw( strftime tzset );
use Ref::Util qw( is_arrayref );
use Time::Moment;
# RECOMMEND PREREQ: Cpanel::JSON::XS
our $VERSION = '6.2';
# Default for Handling Parsing
our $DateParsing = 1;
our $EpochCreate = 1;
our $ExtractProgram = 1;
our $AutoDetectJSON = 0;
our $AutoDetectKeyValues = 0;
our $PruneRaw = 0;
our $PruneEmpty = 0;
our @PruneFields = ();
our $FmtDate;
our $TimeMomentFormatString = "%FT%T%f%z";
# RFC-5424 Parsing
our $RFC5424StructuredData = 1;
our $RFC5424StructuredDataStrict = 0;
# DEPRECATED Settings
our $DateTimeCreate;
our $HiResFmt;
our $OutputTimeZone;
our $NormalizeToUTC;
my %INT_PRIORITY = (
'emerg' => 0,
'alert' => 1,
'crit' => 2,
'err' => 3,
'warn' => 4,
'notice' => 5,
'info' => 6,
'debug' => 7,
);
my %INT_FACILITY = (
#
# POSIX Facilities
'kern' => 0 << 3,
'user' => 1 << 3,
'mail' => 2 << 3,
'daemon' => 3 << 3,
'auth' => 4 << 3,
'syslog' => 5 << 3,
'lpr' => 6 << 3,
'news' => 7 << 3,
'uucp' => 8 << 3,
'cron' => 9 << 3,
'authpriv' => 10 << 3,
'ftp' => 11 << 3,
#
# Local Reserved
'local0' => 16 << 3,
'local1' => 17 << 3,
'local2' => 18 << 3,
( run in 2.101 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )