NAME
Net::Dev::Tools::SyslogMessage - Perl library for Unix/Linux Syslog message parsing
SYNOPSIS
use Net::Dev::Tools::SyslogMessage;
my $msg = syslog_parseMessage($msgstr);
syslog_dumpMessage(\*STDOUT, $msg);
DESCRIPTION
This library is written entirely in Perl, based on, but not fully compliant to, IETF RFC 3164 - The BSD Syslog Protocol.
EXPORT
- syslog_getFacilityName (facilityCode)
-
Returns the syslog facility name (string) that matches the given numerical code
facilityCode
. Returnsundef
iffacilityCode
is undefined or does not match any RFC 3164 numerical facility code. - syslog_getFacilityCode (facilityName)
-
Returns the syslog facility numerical code (int, RFC 3164) that matches the given
facilityName
. Returnsundef
iffacilityName
is undefined or does not match any RFC 3164 facility code. - syslog_getSeverityName (severityCode)
-
Returns the syslog severity name (string) that matches the given numerical code
severityCode
. Returnsundef
ifseverityCode
is undefined or does not match any RFC 3164 numerical severity code. - syslog_getSeverityCode (severityName)
-
Returns the syslog severity numerical code (int, RFC 3164) that matches the given
severityName
. Returnsundef
ifseverityName
is undefined or does not match any RFC 3164 severity code. - syslog_packPriority (facility,severity)
-
Given facility and severity (RFC 3164) codes or names, returns packed syslog priority code (
string
). Returnsundef
iffacility
orseverity
are undefined. - syslog_unpackPriority (priorityCode)
-
Given a syslog priority numerical code (
int
), translates it in a list containing (in order) syslog facility code and severity code. Returnsundef
ifpriorityCode
is undefined. - syslog_dumpMessage (outStream,syslogMessageObj)
-
Prints textual form of a parsed syslog message hashref
syslogMessageObj
on streamoutStream
. - syslog_parseMessage (syslogMessageStr)
-
Parses a received syslog message
syslogMessageStr
and returns a reference to a hash containing syslog message parsed elements.
SEE ALSO
IETF RFC 3164 - The BSD Syslog Protocol <http://www.ietf.org/rfc/rfc3164.txt>
AUTHOR
Dmitri Sologoubenko, <dmitri.sologoubenko@gmail.com>
COPYRIGHT AND LICENSE
Copyright (C) 2007 by Dmitri Sologoubenko
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.