A parser for BSD syslog protocol (RFC 3164) messages
Python
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
syslogmp
tests
.gitignore
.landscape.yaml
.travis.yml
CHANGES.rst
LICENSE
MANIFEST.in
README.rst
setup.cfg
setup.py
tox.ini

README.rst

syslogmp

A parser for BSD syslog protocol (RFC 3164) messages

This library was extracted from syslog2IRC.

Requirements

  • Python 2.7+ or 3.3+
  • enum34 (on Python versions before 3.4)

Installation

Install this package via pip:

$ pip install syslogmp

On Python versions before 3.4, the enum34 package should be installed automatically.

Usage

To parse a syslog message:

from syslogmp import parse

# Parse data (usually received via network).
message = parse(data)

# Let's see what we've got here.
print(message.facility)
print(message.facility.description)
print(message.severity)
print(message.timestamp)
print(message.hostname)
print(message.message)

Further Reading

For more information, see RFC 3164, "The BSD syslog Protocol".

Please note that there is RFC 5424, "The Syslog Protocol", which obsoletes RFC 3164. This package, however, only implements the latter.

Copyright:2007-2016 Jochen Kupperschmidt
Date:01-Mar-2016
License:MIT, see LICENSE for details.
Version:0.2.2