Skip to main content

A parser for BSD syslog protocol (RFC 3164) messages

Project description

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-2015 Jochen Kupperschmidt

Date:

08-Sep-2015

License:

MIT, see LICENSE for details.

Version:

0.2.1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

syslogmp-0.2.1.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

syslogmp-0.2.1-py2.py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page