Skip to main content

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

Metadata

Release files for syslogmp 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for syslogmp 0.4
File Size Uploaded Provenance
syslogmp-0.4.tar.gz 8.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for syslogmp 0.4
File Interpreter ABI Platform
syslogmp-0.4-py3-none-any.whl Python 3 none any Details

Total release size: 16.1 kB

Release files / syslogmp-0.4.tar.gz

Download URL syslogmp-0.4.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bcf94858407cf8993e9bf73dc306157f087db6c66503e74853d0a95bf6a4f0fb
BLAKE2b-256 checksum
How to use checksums
f1f63efd94860ce1e8ddb530833501e3baf38f2dea7080a54118f2658ee0710f
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / syslogmp-0.4-py3-none-any.whl

Download URL syslogmp-0.4-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c25215db4b167d333c829d6e2afd83d7c8fb2ce3957f1b64019fac527398ca23
BLAKE2b-256 checksum
How to use checksums
1df4b210844935a565d534de55ae580b95f7a15afbda7eafad84f1c1b480bc22
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for syslogmp 0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page