Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbg/journalparse
A Python parser for the journald binary export format
https://github.com/jbg/journalparse
Last synced: 24 days ago
JSON representation
A Python parser for the journald binary export format
- Host: GitHub
- URL: https://github.com/jbg/journalparse
- Owner: jbg
- Created: 2016-01-13T23:19:21.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-14T10:26:30.000Z (about 9 years ago)
- Last Synced: 2024-12-08T15:05:17.824Z (about 2 months ago)
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a really simple Python parser for the [journald binary export format](http://www.freedesktop.org/wiki/Software/systemd/export/).
It can parse journal entries from a file-like object or an iterable, and yields each entry as a `dict` containing all attributes of the journal entry.
from __future__ import print_function # if using Python 2.x
from journalparse import journalparse
with open("some_file", "rb") as fp:
for entry in journalparse(fp):
print(entry)# ... or ...
data = b"_MESSAGE=blah"
for entry in journalparse(data):
print(entry)No requirements other than Python. Tested on Python 3.5 but should work on Python 2.6+ and 3.2+.