Skip to main content

View, tail, filter, search, and analyze log files from the command line

Project description

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: --json flag 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

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

logpeek_cli-0.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

logpeek_cli-0.1.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file logpeek_cli-0.1.0.tar.gz.

File metadata

  • Download URL: logpeek_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for logpeek_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 69a72544dbcfc6c95c5edc0d7f2bfd7f57ceae0d405f8919aaeab765f20fa143
MD5 f4b00841f8cb4b358e0fc1d9456c0eb3
BLAKE2b-256 0109129158a43e3b5d6bd733e2da0798fc1237a89db50b527f8544b47de8031c

See more details on using hashes here.

File details

Details for the file logpeek_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: logpeek_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for logpeek_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42f08c8367eee801b29f3d09b4c13f1195dfe0f160a1c933d3c24c74c9d22e56
MD5 fb2ab8e4788ed06c9976d96fff9c7f1b
BLAKE2b-256 e710d4f80e43acd1cf8a6ce075bf09b65a97c03eacbaa4b2036a16fd8692685c

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