The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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. Returns undef if facilityCode 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. Returns undef if facilityName 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. Returns undef if severityCode 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. Returns undef if severityName 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). Returns undef if facility or severity 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. Returns undef if priorityCode is undefined.

syslog_dumpMessage (outStream,syslogMessageObj)

Prints textual form of a parsed syslog message hashref syslogMessageObj on stream outStream.

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.