https://github.com/easypost/syslog-rfc5424-parser
A small Python module to parse RFC5424-formatted Syslog messages
https://github.com/easypost/syslog-rfc5424-parser
Last synced: 6 months ago
JSON representation
A small Python module to parse RFC5424-formatted Syslog messages
- Host: GitHub
- URL: https://github.com/easypost/syslog-rfc5424-parser
- Owner: EasyPost
- License: isc
- Created: 2016-01-15T01:44:44.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-01-05T01:01:16.000Z (about 5 years ago)
- Last Synced: 2025-06-13T03:47:01.918Z (8 months ago)
- Language: Python
- Size: 51.8 KB
- Stars: 38
- Watchers: 50
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
This module implements an [RFC 5424](https://tools.ietf.org/html/rfc5424) IETF Syslog Protocol parser in Python, using the [lark](https://github.com/lark-parser/lark) parser-generator. It should work on Python 3.3+.

[](https://badge.fury.io/py/syslog-rfc5424-parser)
[](https://syslog-rfc5424-parser.readthedocs.io/en/latest/?badge=latest)
The file [example_syslog_server.py](example_syslog_server.py) contains a fully-functional Syslog server which will receive messages on a UNIX domain socket and print them to stdout as JSON blobs.
### A word on performance
On a fairly modern system (Xeon E3-1270v3), it takes about 230µs to parse a single syslog message and construct a SyslogMessage object (which is to say, you should be able to parse about 4300 per second with a single-threaded process). Are you really in that much of a rush, anyway?
If you're interested in a faster, non-Python alternative, you may also enjoy
[rust-syslog-rfc5424](https://github.com/Roguelazer/rust-syslog-rfc5424).