# lnav: Terminal Log Viewer with Built-In SQLite Queries

> lnav is a terminal log viewer that auto-detects formats, merges multiple sources into one timeline, and includes a built-in SQLite query interface.

Published: 2026-03-24
URL: https://daniliants.com/insights/the-logfile-navigator/
Tags: log-files, terminal-tools, cli, devops, log-analysis, self-hosting, sqlite

---

## Summary

lnav is a terminal-based log file viewer that auto-detects formats, decompresses files on the fly, and merges multiple log sources into a single timeline. It includes a built-in SQLite interface for querying log data directly, and can outperform standard tools like grep/awk on large files (benchmarked against a 3.3 GB access log).

## Key Insight

- Zero setup required - point it at a directory and it auto-detects log formats and handles compressed files transparently
- Built-in SQLite interface lets you run SQL queries against log data, which is far more powerful than chaining grep/awk/sed for complex analysis
- Outperforms standard terminal tools on large files in both CPU and memory usage - the project publishes benchmarks against a 3.3 GB access log
- No server component needed - runs entirely in the terminal, making it ideal for SSH sessions on remote servers
- Has a public SSH demo at `demo.lnav.org` so you can try it without installing
- The SQLite interface can also generate charts, meaning you can do basic log visualization without leaving the terminal