| Crates.io | sdjournal |
| lib.rs | sdjournal |
| version | 0.1.6 |
| created_at | 2026-01-03 08:43:03.582129+00 |
| updated_at | 2026-01-04 03:03:13.721467+00 |
| description | Pure Rust systemd journal reader and query engine |
| homepage | https://github.com/lvillis/sdjournal |
| repository | https://github.com/lvillis/sdjournal |
| max_upload_size | |
| id | 2019794 |
| size | 231,694 |
sdjournal is a pure Rust systemd journal reader and query engine. It reads *.journal files directly and does not depend on libsystemd or invoke journalctl (tests may use journalctl for golden comparisons).
Journal::open_default() is Linux-only).This project is validated in CI on:
See .github/workflows/ci.yml for the exact matrix and the logged systemd --version output.
mmap, lz4, zstdxz: enable XZ decompressiontracing: emit diagnostics via tracing (caller installs a subscriber)tokio: provides an async follow adapterverify-seal: verify Forward Secure Sealing (TAG/FSS) with a systemd verification keyuse sdjournal::Journal;
let journal = Journal::open_default()?;
let mut q = journal.query();
q.match_exact("_SYSTEMD_UNIT", b"sshd.service");
q.since_realtime(0);
for item in q.iter()? {
let entry = item?;
if let Some(msg) = entry.get("MESSAGE") {
println!("{}", String::from_utf8_lossy(msg));
}
}
# Ok::<(), sdjournal::SdJournalError>(())
An end-to-end example that persists the last cursor and resumes via after_cursor is in:
crates/sdjournal/examples/checkpoint_follow.rsRun it on Linux:
cargo run -p sdjournal --example checkpoint_follow -- sshd.service /var/tmp/sdjournal.cursor
cargo fmtcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace --all-featurescargo +nightly fuzz run journal_open