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.1.9.tar.gz (9.2 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.1.9-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for journalview-0.1.9.tar.gz
Algorithm Hash digest
SHA256 e429191bb0f12740443b430c2188278327d995cfca98d40990b3354d9e372e8d
MD5 4ed6da2218e9627a7e018f7bf2953c59
BLAKE2b-256 83ab4a6237b41c1c09dd877f2f059fec4510a08889678470c3ea6f0ca81bb704

See more details on using hashes here.

File details

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

File metadata

  • Download URL: journalview-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 8.9 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.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 8a757f0efc3a56f7ac7df4fa19aa2406c4f37369621ff172a79230252ddcd10a
MD5 7205106e348905f561b7b3eb3f2d8344
BLAKE2b-256 ddc263760e06e153820fd6cd5e9f5c3cfcc5f161c4edb3a76f3fe20ba14a15d1

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