A CLI/TUI tool for viewing and filtering log lines
Project description
logdelve
A terminal UI tool for viewing and filtering log lines. Think of it as a lightweight, interactive log viewer with JSON awareness.
Features
- File and pipe input: Read logs from files or pipe them via stdin
- Timestamp parsing: Automatic detection of ISO 8601, syslog, Apache, and other common timestamp formats
- JSON awareness: Detects JSON content in log lines and offers pretty-printing with syntax highlighting
- Pretty-print toggle: Switch between compact and expanded JSON view, globally or per-line
- Interactive filtering: Filter log lines by text pattern or JSON key-value pairs (include or exclude)
- Filter management: Reorder, toggle, delete, clear filters with a dedicated dialog
- Session management: Save, load, rename, delete filter sessions with auto-save
- Live tailing: Follow growing log files in real-time with pause/resume
- AWS CloudWatch: Download and list CloudWatch log groups, streams, and events
Installation
Requires Python 3.13+.
# Install with uv
uv tool install logdelve
# Or install with pip
pip install logdelve
# With AWS CloudWatch support
pip install logdelve[aws]
Commands
logdelve inspect - View log files
# View a log file (auto-tails by default)
logdelve inspect app.log
# Pipe logs from another command
kubectl logs pod-name | logdelve inspect
# Disable automatic tailing
logdelve inspect --no-tail app.log
# Load a saved filter session
logdelve inspect --session my-filters app.log
logdelve cloudwatch - AWS CloudWatch logs
Requires logdelve[aws] (boto3).
# List log groups
logdelve cloudwatch groups
logdelve cloudwatch groups /aws/lambda/
# List streams for a log group
logdelve cloudwatch streams /aws/lambda/my-function
# Download recent logs (last 5 minutes by default)
logdelve cloudwatch get /aws/lambda/my-function stream-prefix
# Download with time range
logdelve cloudwatch get /aws/lambda/my-function prefix -s 1h -e 30m
# Download and view in TUI
logdelve cloudwatch get /aws/lambda/my-function prefix | logdelve inspect
# Tail CloudWatch logs live
logdelve cloudwatch get /aws/lambda/my-function prefix --tail | logdelve inspect
Time formats for --start/--end: 5m, 1h, 2d, 1week, 14:30, or ISO 8601. All times in UTC.
AWS credentials via --profile, --aws-region, --aws-access-key-id, etc. or standard environment variables.
Keybindings
Navigation
| Key | Action |
|---|---|
| Up / Down | Move between log lines |
| PgUp / PgDn | Page up / down |
| Home / End | Jump to first / last line |
| gg | Jump to first line |
| G | Jump to last line |
JSON Display
| Key | Action |
|---|---|
| j | Toggle pretty-print for ALL JSON lines |
| Enter | Toggle pretty-print for the current line (sticky) |
| n | Toggle line numbers |
Filtering
| Key | Action |
|---|---|
| / | Filter in (text or key=value) |
| \ | Filter out (text or key=value) |
| m | Manage filters (toggle, delete, clear, reorder) |
| 1-9 | Toggle individual filters on/off |
On JSON lines, / and \ show key-value suggestions.
Tailing
| Key | Action |
|---|---|
| p | Pause/resume tailing |
| G | Jump to bottom (follow new lines) |
Sessions
| Key | Action |
|---|---|
| s | Session manager (load, save, delete, rename) |
General
| Key | Action |
|---|---|
| h, ? | Show help screen |
| q | Quit |
Log Format
logdelve expects each line to begin with a timestamp, followed by either a JSON object or plain text:
2024-01-15T10:30:00Z {"log_level": "info", "message": "Request processed", "duration_ms": 42}
2024-01-15T10:30:01Z Connection established from 192.168.1.1
Jan 15 10:30:02 myhost syslogd: restart
Lines without a recognized timestamp are displayed as-is.
Sessions
Filter sessions are stored in ~/.config/logdelve/sessions/ as TOML files. Filters are auto-saved on every change. Use --session to load a session on startup.
Development
# Clone the repo
git clone https://github.com/chassing/logdelve.git
cd logdelve
# Install dependencies
uv sync
# Run from source
uv run logdelve inspect sample.log
# Run all checks (lint, format, typecheck, tests)
make test
# Individual targets
make lint # ruff check
make format # ruff format
make typecheck # mypy
make clean # remove caches
Releasing
- Update version in
pyproject.toml - Update
CHANGELOG.md - Commit and push:
git commit -am "Release vX.Y.Z" && git push - Create a GitHub release:
gh release create vX.Y.Z --title "vX.Y.Z" --notes "See CHANGELOG.md" - The
publish.ymlworkflow builds and publishes to PyPI automatically
Requires PYPI_TOKEN secret in the GitHub repo settings.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logdelve-0.1.0.tar.gz.
File metadata
- Download URL: logdelve-0.1.0.tar.gz
- Upload date:
- Size: 21.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43e0ce24a61adc3ed3da21b94fe4e659626a61fbc0775d121faadda9de36f2f9
|
|
| MD5 |
994bee2ac87f97241fcc839d0b3cc549
|
|
| BLAKE2b-256 |
6a7c33f87b6cbbc8e892ee7a3c6df0d093819354a398e4970f95b874880e9915
|
File details
Details for the file logdelve-0.1.0-py3-none-any.whl.
File metadata
- Download URL: logdelve-0.1.0-py3-none-any.whl
- Upload date:
- Size: 31.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd0328d61550f716ad75d41e90eed91d1642dcab5305d40d1633558c60ee37a9
|
|
| MD5 |
a946fe5184a557e1610ae761e494d40d
|
|
| BLAKE2b-256 |
22ee4c7834c61ae6d647c549a483c19fd9a4ebc24d6ddb4f48397b9d7a632072
|