Skip to main content

Kubelog

Docker and Kubernetes log aggregation, inspection, export, and preview toolkit.

PyPI Python License Stars


Kubelog is a terminal-first log aggregation tool for teams that need to inspect container logs without standing up a full observability stack. It reads Docker JSON logs, Kubernetes CRI/containerd logs, structured JSON logs, plain text logs, directories of log files, and stdin; normalizes them into one schema; then provides Rich terminal summaries, search, severity filtering, time bucketing, exports, comparisons, and a local Flask preview dashboard.

  • Multi-format ingestion - Parse Docker JSON, Kubernetes CRI/containerd, JSON application logs, plain text logs, directories, and pipes.
  • Log aggregation - Group by level, source, parser, namespace, pod, container, service, stream, or time bucket.
  • Search and filtering - Filter by query, severity, minimum severity, namespace, pod, container, service, and time range.
  • Export workflows - Write normalized logs as JSONL, CSV, or a self-contained HTML report.
  • Preview server - Launch a local Flask dashboard with HTML views and JSON APIs for logs, summary, and time buckets.
  • Dataset comparison - Compare two log captures by severity or Kubernetes metadata to spot regressions quickly.

Installation

pip install kubelog

Usage

Inspect a Docker JSON log:

kubelog inspect /var/lib/docker/containers/app/app-json.log

Aggregate Kubernetes pod logs by severity:

kubelog aggregate /var/log/pods --by level

Search for errors in piped logs:

kubectl logs deploy/api --all-containers | kubelog search "timeout" -

Export normalized logs:

kubelog export ./logs --format csv --out build/logs.csv --min-level WARN
kubelog export ./logs --format html --out build/report.html

Serve a local dashboard:

kubelog serve ./logs --port 8765

Compare two captures:

kubelog compare before.log after.log --by level

Commands

Command Description
kubelog inspect [paths...] Inspect source types, parsers, levels, services, top messages, and time range.
kubelog collect [paths...] Normalize and print logs from files, directories, or stdin.
kubelog aggregate [paths...] Aggregate logs by severity, source, Kubernetes metadata, or time bucket.
kubelog search <query> [paths...] Search normalized log messages and source paths.
kubelog tail [paths...] Print newest entries and optionally follow appended file logs.
kubelog export [paths...] Export logs as JSONL, CSV, or HTML.
kubelog serve [paths...] Start a local Flask dashboard and JSON API server.
kubelog compare <left> <right> Compare two log captures by severity or metadata field.

Configuration

Kubelog works without a config file. Use command flags to control parsing, filtering, and output:

kubelog collect ./logs \
  --source auto \
  --min-level WARN \
  --namespace production \
  --since 2h \
  --limit 200

Supported parser hints are auto, docker, kubernetes, k8s, cri, containerd, json, and plain. Relative time filters accept 15m, 2h, and 1d; ISO timestamps are also supported.

License

MIT License. See LICENSE.

Metadata

Release files for kubelog 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kubelog 0.1.0
File Size Uploaded
kubelog-0.1.0.tar.gz 15.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kubelog 0.1.0
File Interpreter ABI Platform
kubelog-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.5 kB

Release files / kubelog-0.1.0.tar.gz

Download URL kubelog-0.1.0.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
66fa933615cc5f552e02501b27c804962949251e201aa51094c5581c0ab7a4da
BLAKE2b-256 checksum
How to use checksums
4a0145ecae72e272d2f557cd2c06c766d49e53056176f1fde4564304a6681328
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / kubelog-0.1.0-py3-none-any.whl

Download URL kubelog-0.1.0-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e97ef7b4a7bff3a8f3f3fe08db0e614320c88a8cb2fb2988d3d0a5e06c67f3ec
BLAKE2b-256 checksum
How to use checksums
e5fc5a0009cacb90f18a056ba64099a84074458d96a24dfcc85a09ef76657bc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page