LogLens Core 🔍
The lightning-fast, structured log parsing engine built in Rust.
loglens-core is a high-performance library designed to parse, query, and analyze structured logs (JSON, Nginx, Logfmt) at scale. It powers the LogLens CLI.
🚀 Features
- Zero-Config Parsing: Automatically detects and parses JSON or Logfmt lines without manual schema definition.
- Structured Query Engine: Filter logs with complex logic using a familiar syntax:
level == "error" && latency > 500. - High Throughput: Optimized for reading gigabytes of logs in seconds, making it suitable for high-volume production environments.
- Time-Aware: Native understanding of timestamps for time-range filtering.
📦 Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
⚡ Usage Example
Here is how you can use loglens-core to parse a log line and run a structured query against it:
use ;
🖥️ Want the full CLI experience?
This library is the engine behind LogLens, a terminal-based log explorer that replaces jq and tail -f with a powerful TUI.
LogLens Pro features:
- 📊 Interactive TUI: Filter and explore logs with keyboard shortcuts.
- 👀 Live Watch: Real-time filtering and highlighting (
loglens watch). - 📈 Instant Stats: Automatic field analysis and error rate calculation.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
This project is licensed under the MIT License.