Skip to main content

A parser for BSD syslog protocol (RFC 3164) messages

Project description

syslogmp

A parser for BSD syslog protocol (RFC 3164) messages

This library was extracted from syslog2IRC.

Requirements

  • Python 3.7+

Installation

Install this package via pip:

$ pip install syslogmp

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

License:

MIT, see LICENSE for details.

Changelog

Version 0.4

Released 2021-04-04

  • Removed support for Python versions 3.6.

  • Turn namedtuples Message and PriorityValue into dataclasses.

  • Added type hints.

Version 0.3

Released 2021-03-03

  • Removed support for end-of-life Python versions 2.7, 3.3, 3.4, and 3.5.

  • Added support for Python 3.6, 3.7, 3.8, and 3.9.

Version 0.2.2

Released 2016-03-01

  • Fixed datetime.strptime failing on February 29th. (Tests introduce a test dependency on FreezeGun).

Version 0.2.1

Released 2015-09-08

  • Added missing files to distribution.

Version 0.2

Released 2015-09-07

  • Data is required to be a byte string.

  • Raise custom exception on message parsing errors instead of using assertions.

  • Raise exception if message is too long instead of truncating and processing it.

Version 0.1.1

Released 2015-08-10

  • Fixed packaging issue.

Version 0.1

Released 2015-08-10

  • first official release

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.4.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

syslogmp-0.4-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file syslogmp-0.4.tar.gz.

File metadata

  • Download URL: syslogmp-0.4.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.3

File hashes

Hashes for syslogmp-0.4.tar.gz
Algorithm Hash digest
SHA256 bcf94858407cf8993e9bf73dc306157f087db6c66503e74853d0a95bf6a4f0fb
MD5 7ac30e270492f2cbdd88870880b61c84
BLAKE2b-256 f1f63efd94860ce1e8ddb530833501e3baf38f2dea7080a54118f2658ee0710f

See more details on using hashes here.

File details

Details for the file syslogmp-0.4-py3-none-any.whl.

File metadata

  • Download URL: syslogmp-0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.3

File hashes

Hashes for syslogmp-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c25215db4b167d333c829d6e2afd83d7c8fb2ce3957f1b64019fac527398ca23
MD5 e95a4cfb534e0e4afa4298d198736e8c
BLAKE2b-256 1df4b210844935a565d534de55ae580b95f7a15afbda7eafad84f1c1b480bc22

See more details on using hashes here.

Supported by

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