Skip to main content

Python package to monitor and profile linux journal boot sequence

Project description

journalview

A small CLI utility to inspect systemd journal boot logs (journalctl) and profile service startup times.

What it does

  • Reads journal entries for a specific boot (via journalctl -b -o json) or from a test file on non-Linux systems.
  • Presents a human-friendly table (using Rich) showing:
    • Time (YYYY-MM-DD HH:MM:SS)
    • ServiceName
    • Message
    • Elapsed (time since previous displayed log)
    • Status (mapped from PRIORITY and color-coded)
    • SvcTotal (time since first log for this service)
    • Total (time since boot start)
  • Provides a summary mode that lists, per service, the first-seen time and the duration between first and last log for that service.
  • Supports filtering by service names (also matches .service units automatically).
  • Colorizes Status and Elapsed columns to highlight slow or error conditions.

Windows / Test mode

On Windows or when journalctl is not available, journalview reads newline-delimited JSON from tests/journal_logs/journal.json (the same format produced by journalctl -o json). This allows development and testing without a Linux journal.

API

The JournalCtl class separates data collection from presentation:

  • collect_data(entries) -> structured rows (timestamps and timedeltas preserved)
  • get_summary_data(entries) -> per-service summary
  • print_table(rows) and print_summary_table(summary_rows) -> render using Rich This separation makes it easy to export results as JSON/YAML in the future by consuming the collected data.

Installation

  • Python 3.8+
  • Recommended packages: click, rich
  • Optional: trogon (used for TUI integration in this repository)

You can install requirements with pip:

pip install click rich

Usage

Run the CLI from the package root, for example:

python -m journalview.journalview view --service all python -m journalview.journalview view -s sshd -b 0 python -m journalview.journalview view -s sshd --summary

Options

  • --service / -s : one or more service identifiers to filter (default: all)
  • --boot / -b : boot index (0..N) to inspect
  • --summary / -S : show per-service summary instead of the detailed table

Notes

  • The tool expects journalctl JSON output format. The test-file used for Windows should contain one JSON object per line.
  • Matching of services is exact; pass the systemd unit name (or the syslog identifier). The code also attempts to match the provided name with a ".service" suffix.

License

MIT

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

journalview-0.2.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

journalview-0.2.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file journalview-0.2.0.tar.gz.

File metadata

  • Download URL: journalview-0.2.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for journalview-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bad9f8cb3d081bc71435c4070437512f9de830f37cacbce6075734ef14f4b8ca
MD5 44aab577e85c2abd0ba672b194711c67
BLAKE2b-256 71e47f8eda3e70c396c87ed9bb7bde3f8425e7923cdebe78e2a1be64c1e6bf1c

See more details on using hashes here.

File details

Details for the file journalview-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: journalview-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for journalview-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10c2f4dc9202d9077a6873bb2c0473eb88418ab836da60020bda6aebf9460695
MD5 49c7c5c227701f8c479fc8e2e11f6b33
BLAKE2b-256 4da274a64327fe88df9bfca8b058db173b019e66b6d9cb31b0afd33dc42952cd

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