| Crates.io | logutil |
| lib.rs | logutil |
| version | 0.12.4 |
| created_at | 2024-07-07 05:41:01.216928+00 |
| updated_at | 2025-07-28 09:53:53.441064+00 |
| description | log Util is a Rust-based tool designed to help you monitor and analyze Nginx access logs in real-time. |
| homepage | https://github.com/s00d/logutil |
| repository | https://github.com/s00d/logutil |
| max_upload_size | |
| id | 1294564 |
| size | 307,224 |

LogUtil is a powerful, real-time log analysis tool written in Rust that provides an interactive terminal interface for monitoring and analyzing Nginx access logs. It offers comprehensive log parsing, real-time monitoring, and detailed analytics with a beautiful TUI (Terminal User Interface).

When you run LogUtil without specifying a log file, it launches an interactive file selection mode:
File Selector Features:
Settings Configuration: After selecting a log file, you'll see an interactive settings screen where you can configure:
Usage:
# Launch interactive mode
logutil
# Or specify a file directly
logutil /path/to/access.log
Navigation:
File Selector:
Settings:
TUI Controls:
Interactive mode with pre-configured parameters:
# Launch file selector with all analysis tabs enabled
cargo run "" --enable-security --enable-performance --enable-errors --enable-bots --enable-sparkline --enable-heatmap --count=1000
# Launch with custom settings
cargo run "" --enable-security --enable-performance --top=20 --count=500
# Launch with specific analysis tabs only
cargo run "" --enable-security --enable-errors --count=2000
Direct file analysis with all features:
# Analyze with all tabs enabled
logutil access.log --enable-security --enable-performance --enable-errors --enable-bots --enable-sparkline --enable-heatmap --count=1000
# Security-focused analysis
logutil access.log --enable-security --enable-errors --top=50
# Performance monitoring
logutil access.log --enable-performance --enable-sparkline --enable-heatmap
Download the latest release for your platform:
Linux (x86_64):
curl -L -o /usr/local/bin/logutil https://github.com/s00d/logutil/releases/latest/download/logutil-x86_64-unknown-linux-gnu
chmod +x /usr/local/bin/logutil
Linux (ARM64):
curl -L -o /usr/local/bin/logutil https://github.com/s00d/logutil/releases/latest/download/logutil-aarch64-unknown-linux-gnu
chmod +x /usr/local/bin/logutil
macOS:
curl -L -o /usr/local/bin/logutil https://github.com/s00d/logutil/releases/latest/download/logutil-x86_64-apple-darwin
chmod +x /usr/local/bin/logutil
curl --proto '=https' --tlsv1.2 -sSf https://sh.rust-lang.org | sh
git clone https://github.com/s00d/logutil.git
cd logutil
cargo build --release
sudo cp target/release/logutil /usr/local/bin/
Monitor a log file in real-time:
logutil /var/log/nginx/access.log
Analyze the entire log file:
logutil /var/log/nginx/access.log --count=-1
Show only the last 1000 lines:
logutil /var/log/nginx/access.log --count=1000
Custom regex pattern:
logutil /var/log/nginx/access.log --regex='^(\S+) - - \[(.*?)\] "(\S+) (\S+) HTTP/\d+\.\d+" (\d+) (\d+) "([^"]*)" "([^"]*)"$'
Show top 20 entries:
logutil /var/log/nginx/access.log --top=20
Disable automatic cleanup:
logutil /var/log/nginx/access.log --no-clear
Custom date format:
logutil /var/log/nginx/access.log --date-format="%d/%b/%Y:%H:%M:%S %z"
Load regex from file:
logutil /var/log/nginx/access.log --regex=/path/to/regex.txt
By default, only the core tabs (Overview, Requests, Detailed) are enabled. Additional tabs can be enabled using command-line flags:
Enable Security tab (detect suspicious activity, attacks, etc.):
logutil /var/log/nginx/access.log --enable-security
Enable Performance tab (monitor response times, slow requests):
logutil /var/log/nginx/access.log --enable-performance
Enable Errors tab (track error codes and failed requests):
logutil /var/log/nginx/access.log --enable-errors
Enable Bots tab (detect bot traffic and crawlers):
logutil /var/log/nginx/access.log --enable-bots
Enable Sparkline tab (real-time request rate visualization):
logutil /var/log/nginx/access.log --enable-sparkline
Enable Heatmap tab (hourly traffic patterns visualization):
logutil /var/log/nginx/access.log --enable-heatmap
Enable all tabs:
logutil /var/log/nginx/access.log --enable-security --enable-performance --enable-errors --enable-bots --enable-sparkline --enable-heatmap
Show top URLs in console:
logutil /var/log/nginx/access.log --show-urls --top=10
Show top IPs in console:
logutil /var/log/nginx/access.log --show-ips --top=10
Tab or t: Switch between tabs (Overview → Requests → Detailed → Sparkline → Heatmap)↑/↓: Navigate through lists←/→: Switch between panels or pagesEnter: Copy selected item to clipboard (in Overview tab)q or Ctrl+C: Quit the application| Option | Description | Default |
|---|---|---|
file |
Path to the log file | Required |
--count |
Lines to read from end (0=tail, -1=all) | 0 |
--regex |
Regex pattern or file path | Nginx default |
--date-format |
Date parsing format | %d/%b/%Y:%H:%M:%S %z |
--top |
Number of top entries to show | 10 |
--no-clear |
Disable automatic cleanup | false |
--show-urls |
Output top URLs to console | false |
--show-ips |
Output top IPs to console | false |
--log-to-file |
Enable logging to app.log | false |
--enable-security |
Enable Security tab | false |
--enable-performance |
Enable Performance tab | false |
--enable-errors |
Enable Errors tab | false |
--enable-bots |
Enable Bots tab | false |
--enable-sparkline |
Enable Sparkline tab | false |
--enable-heatmap |
Enable Heatmap tab | false |
^(\S+) - ".+" \[(.*?)\] \d+\.\d+ "(\S+)" "(\S+) (\S+?)(?:\?.*?)? "
Date Format: %d/%b/%Y:%H:%M:%S %z
^(\S+) \S+ \S+ \[.*?\] "\S+ (\S+?)(?:\?.*?)? \S+" \d+ \d+
Date Format: %d/%b/%Y:%H:%M:%S %z
^(\S+) - - \[(.*?)\] "(\S+) (\S+) HTTP/\d+\.\d+" (\d+) (\d+) "([^"]*)" "([^"]*)"$
Date Format: %d/%b/%Y:%H:%M:%S %z
# Monitor nginx access logs in real-time
logutil /var/log/nginx/access.log
# Analyze entire log file
logutil /var/log/nginx/access.log --count=-1 --top=20
# Apache access logs
logutil /var/log/apache2/access.log --regex='^(\S+) \S+ \S+ \[.*?\] "\S+ (\S+?)(?:\?.*?)? \S+" \d+ \d+'
# Custom application logs
logutil /var/log/app/access.log --regex='^(\S+) \[(.*?)\] (\S+) (\S+)'
# Get top URLs for reporting
logutil /var/log/nginx/access.log --show-urls --top=10
# Get top IPs for security analysis
logutil /var/log/nginx/access.log --show-ips --top=20
# Custom regex from file
logutil /var/log/nginx/access.log --regex=/etc/logutil/patterns.txt
# Disable cleanup for long-term analysis
logutil /var/log/nginx/access.log --no-clear --count=-1
# Custom date format
logutil /var/log/nginx/access.log --date-format="%Y-%m-%d %H:%M:%S"
--no-clear to disable automatic cleanup1. "No match for line" errors
--regex option--log-to-file to debug parsing issues2. High memory usage
--count to limit initial processing--no-clear only for short-term analysis3. Slow performance with large files
--count=1000 to limit initial processing# Enable debug logging
logutil /var/log/nginx/access.log --log-to-file
# Check the generated app.log file for errors
tail -f app.log
We welcome contributions! Please see our Contributing Guidelines for details.
git clone https://github.com/s00d/logutil.git
cd logutil
cargo build
cargo test