Timberjack 🪓
Timberjack: Fell Your Logs Fast - A lightning-fast CLI log analysis tool built in Rust.
📋 Overview
Timberjack is a log-agnostic CLI tool that chops through noise to deliver patterns, trends, and stats from your logs. It's designed to be portable, requiring no servers or complex setup, and works with logs from any source—Java, Rust, Python, or any text-based logs.
✨ Key Features
- Fast JSON Processing: 70-90x faster than jq for large JSON logs
- Pattern Matching: On par with grep for small files, with richer analysis capabilities
- Parallel Processing: Up to 57% faster analysis of large files with automatic multi-threading
- Statistical Analysis: Get insights on log levels, error types, and message uniqueness
- Memory Efficiency: Low memory footprint even with large log files
- Automatic Format Detection: Intelligently handles both plaintext and JSON logs
- Stdin Support: Seamless piping and streaming log analysis
🚀 Installation
🌐 Stdin and Piping Superpowers
Timberjack now supports stdin input, making log analysis incredibly flexible:
# Pipe logs from any source
|
|
|
# Quick counting
|
| |
# Advanced analysis
|
Pro Tips:
- Automatically detects log formats from stdin
- Supports compressed logs via zcat/gunzip
- Memory-mapped processing for large input streams
- Works with JSON, plaintext, and mixed log formats
🔨 Quick Examples
# Basic log analysis with automatic format detection
# Find errors and show statistics
# Analyze JSON logs and filter by specific fields
# Get just the count of errors (fastest mode)
# Use parallel processing for large files
📊 Benchmark Results
Our latest benchmarks show impressive performance across various operations:
JSON Processing (vs jq)
| File Size | Timberjack | jq | Speedup |
|---|---|---|---|
| 10K lines | 0.074s | 0.814s | 11x faster |
| 100K lines | 0.156s | 7.149s | 46x faster |
| 1M lines | 0.967s | 69.529s | 72x faster |
Pattern Matching
| File Size | timber-chop-count | grep | ripgrep |
|---|---|---|---|
| 10K lines | 0.069s | 0.072s | 0.138s |
| 100K lines | 0.092s | 0.079s | 0.112s |
| 1M lines | 0.405s | 0.128s | 0.140s |
Parallel Processing (10M lines)
| Operation | Sequential | Parallel | Improvement |
|---|---|---|---|
| Standard Processing | 10.609s | 7.157s | 32% faster |
| Pattern Matching | 6.541s | 3.514s | 46% faster |
| JSON Processing | 30.603s | 12.976s | 58% faster |
📚 Detailed Usage
Pattern Searching
# Find logs containing "Exception"
# Count occurrences (fastest)
# Combine with level filtering
JSON Log Analysis
# Process JSON logs (auto-detected)
# Filter by JSON fields
# Complex field filtering
Statistical Analysis
# Get comprehensive statistics
# Show time-based trends
# Show unique messages in stats
# Output top 10 error types
Performance Options
# Force parallel processing for large files
# Memory-efficient mode
# Output JSON for programmatic use
🔍 When to Use Timberjack
- Complex JSON Logs: Timberjack outperforms specialized tools like jq by 46-72x on large files
- All-in-One Analysis: Replaces grep, jq, and custom scripts with one unified tool
- Large Log Files: Automatic parallelization for multi-gigabyte logs
- Statistical Insights: When you need more than just matching lines
- CI/CD Pipelines: Fast and reliable log analysis in automated environments
🛠️ Command-Line Options
| Option | Description |
|---|---|
--chop <PATTERN> |
Search for logs matching pattern (regex supported) |
--level <LEVEL> |
Filter by log level (ERROR, WARN, INFO, etc.) |
--trend |
Show time-based trends of log occurrences |
--stats |
Show summary statistics |
--count |
Output only the count (faster) |
--format <FORMAT> |
Specify log format (auto, json) |
-f, --field <FIELD=VALUE> |
Filter by field value (for JSON logs) |
--parallel |
Force parallel processing |
--json |
Output results in JSON format |
--top-errors <N> |
Number of top error types to show (default: 5) |
--show-unique |
Show unique messages in stats output |
📝 Roadmap
- VS Code extension (coming May 2025)
- Multi-file analysis
- Interactive TUI mode
- Advanced pattern correlation
🤝 Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
📄 License
Timberjack is licensed under the MIT License - see the LICENSE file for details.