logpeek
View, tail, filter, search, and analyze log files from the command line. Think tail -f meets grep with stats and JSON output.
Install
pip install logpeek-cli
Commands
logpeek view app.log # View with syntax highlighting
logpeek view app.log -n 50 # Last 50 lines
logpeek tail app.log # Live tail (like tail -f)
logpeek filter app.log --level error # Filter by log level
logpeek filter app.log -l warning -v # Exclude warnings
logpeek search app.log "pattern" # Regex search
logpeek search app.log "error" -C 3 # With 3 lines context
logpeek search app.log "fail" -c # Count matches
logpeek stats app.log # Log level distribution
logpeek between app.log --from "2026-02-08" --to "2026-02-09"
logpeek extract app.log --field ip # Extract IP addresses
logpeek extract app.log -f url -u # Unique URLs
logpeek top app.log --field ip -n 10 # Top 10 IPs
Features
- Auto-detect log formats: syslog, nginx, Apache, JSON lines, generic timestamped
- Log level detection: ERROR, WARNING, INFO, DEBUG with colorized output
- Regex search: with context lines (
-A,-B,-C) like grep - Time range filtering: parse timestamps from any common format
- Statistics: level distribution, lines per hour, error rate
- Field extraction: IPs, URLs, emails, HTTP status codes
- Top N analysis: most frequent values for any extractable field
- JSON output:
--jsonflag on every command - Stdin support: pipe logs from other commands
- No heavy deps: just Python + Click
Stdin / Pipelines
cat /var/log/syslog | logpeek filter --level error
kubectl logs pod-name | logpeek stats
docker logs container | logpeek search "timeout" -C 2
journalctl -u nginx | logpeek top --field ip -n 20
JSON Output
Every command supports --json for machine-readable output:
logpeek stats app.log --json
logpeek top app.log -f status --json
logpeek search app.log "error" --json
For AI Agents
See SKILL.md for structured command reference and usage patterns.
License
MIT
Release files for logpeek-cli 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| logpeek_cli-0.1.0.tar.gz | 9.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| logpeek_cli-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.9 kB
Release files / logpeek_cli-0.1.0.tar.gz
| Download URL | logpeek_cli-0.1.0.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69a72544dbcfc6c95c5edc0d7f2bfd7f57ceae0d405f8919aaeab765f20fa143
|
|
BLAKE2b-256 checksum How to use checksums |
0109129158a43e3b5d6bd733e2da0798fc1237a89db50b527f8544b47de8031c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / logpeek_cli-0.1.0-py3-none-any.whl
| Download URL | logpeek_cli-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
42f08c8367eee801b29f3d09b4c13f1195dfe0f160a1c933d3c24c74c9d22e56
|
|
BLAKE2b-256 checksum How to use checksums |
e710d4f80e43acd1cf8a6ce075bf09b65a97c03eacbaa4b2036a16fd8692685c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|