Log Parser CLI
Parse logs like a pro. Apache, Nginx, JSON, custom formats.
Filter. Aggregate. Analyze. Export.
Quick Start
bash
npm install -g @lxgicstudios/logparse
bash
# Parse Nginx access log logparse nginx /var/log/nginx/access.log # Filter errors logparse parse app.log --level error # Top IPs logparse nginx access.log --top-ips 10
Supported Formats
| Format | Auto-detected |
|---|---|
| Nginx access | ✓ |
| Apache access | ✓ |
| Apache error | ✓ |
| JSON lines | ✓ |
| Syslog | ✓ |
| Custom (regex) | Manual |
Commands
bash
# Parse with auto-detection
logparse parse app.log
# Filter by time range
logparse parse app.log --after "2024-01-01" --before "2024-01-31"
# Filter by status code
logparse nginx access.log --status 5xx
# Aggregate by endpoint
logparse nginx access.log --group path --count
# Top slowest requests
logparse nginx access.log --sort response_time --desc -n 20
# Extract IPs making errors
logparse nginx access.log --status 5xx --extract ip
# Custom regex pattern
logparse parse app.log --pattern "(?<timestamp>\d{4}-\d{2}-\d{2}) (?<level>\w+) (?<message>.*)"
# Export to JSON
logparse nginx access.log -o analysis.json
Analysis Features
bash
# Request rate over time logparse nginx access.log --rate 1h # Status code distribution logparse nginx access.log --stats status # Bandwidth usage logparse nginx access.log --bandwidth
When to Use This
- •Debugging production issues
- •Security analysis
- •Performance monitoring
- •Usage analytics
- •Incident investigation
Built by LXGIC Studios