What is lnav?
lnav, the Logfile Navigator, is a log viewer for the terminal that merges log files from many sources into one view ordered by timestamp. Point it at a few files, a directory or a compressed archive and it works out the formats by itself (syslog, the systemd journal, Apache and nginx access logs, JSON lines and many more), interleaves the messages by time, colours errors and warnings so they stand out, and keeps following the files as they grow. From there you filter, search, jump between errors, and when a question needs more than a search, you query the log messages with SQL. It opens remote logs over ssh as easily as local ones. lnav is written in C++ by Tim Stack and is BSD-2-Clause licensed.
apt upgrade.
⚡ Key Features of lnav
🔀 One Merged Timeline
Open the syslog, an application log and a web server log together and lnav interleaves their lines by timestamp, so you read what happened across the whole system in the order it happened.
🔍 Automatic Format Detection
syslog, journald JSON, Apache and nginx access logs, JSON lines, logfmt and dozens more are recognised without configuration; levels, timestamps and fields are parsed, and errors and warnings are highlighted.
🗄️ SQL over Your Logs
Every recognised format is a table. Press ; and run SELECT queries against the log messages: count errors per host, find the slowest requests, group status codes, with the results shown in the same window.
🌐 Remote Logs over ssh
lnav user@host:/var/log/syslog opens a log on another machine through your normal ssh setup and keys, with no agent to install on the server.
📦 Compressed Files and Archives
Rotated .gz and .bz2 logs open directly, and so do .zip and .tar archives, so a support bundle can be read without unpacking it first.
👀 Follow, Filter and Search
Files are tailed as they grow, filters hide or keep lines by pattern, searches highlight every match, and single keys jump to the next error or warning, so nothing important scrolls past.
apt upgrade keeps you on the latest version.
📦 Installation from deb.griffo.io
Step 1: Add Repository
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
echo "deb [signed-by=/etc/apt/keyrings/deb.griffo.io.gpg] https://deb.griffo.io/apt $(. /etc/os-release; echo ${DEBIAN_CODENAME:-${UBUNTU_CODENAME:-$VERSION_CODENAME}}) main" | sudo tee /etc/apt/sources.list.d/deb.griffo.io.list > /dev/null
sudo apt updateinstall -d -m 0755 /etc/apt/keyrings
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
echo "deb [signed-by=/etc/apt/keyrings/deb.griffo.io.gpg] https://deb.griffo.io/apt $(. /etc/os-release; echo ${DEBIAN_CODENAME:-${UBUNTU_CODENAME:-$VERSION_CODENAME}}) main" | tee /etc/apt/sources.list.d/deb.griffo.io.list > /dev/null
apt updatesudo apt install extrepo
sudo extrepo enable griffo
sudo apt update🆓 There is an always-free mirror. deb-free.griffo.io serves packages free forever, no account, no subscription, at most 2 months behind upstream, security fixes immediately. It currently carries cliamp, Ghostty, lazydocker, Oh My Posh, Uncloud and Zed; lnav is not one of them, so the repository above is the only way to get it today, ask and it can be enrolled.
🧩 About the extrepo option. extrepo is Debian's own tool for external repositories: it writes the sources file and installs the signing key for you, checking the key against signed metadata first. This repository is registered with it as griffo, and the always-free mirror as griffo-free, so on Debian (bookworm, trixie, forky and sid) the commands above are the whole setup.
extrepo sets up the sources file and the key only, so a subscription's credentials still go in /etc/apt/auth.conf.d/deb.griffo.io.conf. Ubuntu is not covered, because extrepo publishes metadata for Debian suites only: there, use the sudo or root commands.
Step 2: Install lnav
# Install latest lnav (replaces the distribution's older lnav in place)
sudo apt install lnav
# Verify installation
dpkg -s lnav | grep Version# Install latest lnav (replaces the distribution's older lnav in place)
apt install lnav
# Verify installation
dpkg -s lnav | grep VersionStep 3: First run
# Logs under /var/log are readable by root and the adm group
sudo lnav /var/log
# No rsyslog (the Debian default)? Read the systemd journal as JSON
journalctl -o json | lnav
# Your own logs need no sudo; formats are detected
lnav ~/app/logs/
# Press ? inside lnav for the built-in help, q to quit# Logs under /var/log are readable by root and the adm group
lnav /var/log
# No rsyslog (the Debian default)? Read the systemd journal as JSON
journalctl -o json | lnav
# Your own logs need no sudo; formats are detected
lnav ~/app/logs/
# Press ? inside lnav for the built-in help, q to quit🎯 Basic Usage Examples
Reading and following logs:
# Rotated and compressed logs open directly, as do archives
lnav /var/log/nginx/access.log.2.gz support-bundle.tar.gz
# Several sources, merged into one timeline by timestamp
lnav /var/log/nginx/ ~/app/logs/app.log
# A log on another machine, over your normal ssh setup
lnav user@host:/var/log/syslogFiltering and SQL:
# Inside lnav: e / E jump to the next / previous error, w / W to warnings
# :filter-in error keep only matching lines
# :filter-out healthcheck hide matching lines
# ;SELECT c_ip, count(*) AS hits FROM access_log GROUP BY c_ip ORDER BY hits DESC
# The same query without the interface, for scripts
lnav -n -c ';SELECT sc_status, count(*) FROM access_log GROUP BY sc_status' /var/log/nginx/access.logKeeping it current:
# lnav updates with the rest of the system
sudo apt update && sudo apt upgrade
# Which version is installed, and which is the newest available
apt policy lnav
# Remove it again
sudo apt remove lnav# lnav updates with the rest of the system
apt update && apt upgrade
# Which version is installed, and which is the newest available
apt policy lnav
# Remove it again
apt remove lnav🔧 Tool Integrations
lnav reads whatever produces text, from files, from pipes and from other machines:
- ssh: remote paths like
user@host:/var/log/sysloggo through your existing ssh config and keys; the package recommendsopenssh-clientfor this - systemd journal: pipe
journalctl -o json(add-fto follow) into lnav and every journal field becomes searchable and queryable - Containers:
docker logs -f app 2>&1 | lnavorkubectl logs -f pod | lnavgives container output the same highlighting and SQL - Clipboard: mark lines and press
cto copy them; the package suggestswl-clipboardorxclipfor Wayland and X11 - Custom formats: describe an in-house log format in a JSON file and install it with
lnav -i myformat.json; it then gets detection, highlighting and its own SQL table - Scripts and CI:
lnav -n -cruns commands and queries headless, so the same SQL that answers a question interactively can run in a cron job or a pipeline - Documentation: the man page comes with the package (
man lnav), and the full manual is at docs.lnav.org
🚀 Why Choose deb.griffo.io?
- Official Debian: ships lnav 0.12.4 in trixie and 0.11.1 in Bookworm, each frozen for the life of its release
- Upstream downloads: a zip with a static binary on the GitHub releases page, copied into your PATH by hand, without the man page, and fetched again for every release
- Building from source: a C++ toolchain plus the SQLite, PCRE2, ncurses, libarchive and libcurl development packages, and a long compile
- deb.griffo.io: latest version with automatic updates
- ✅ Same Package Name as Debian: the package is
lnav, exactly what the Debian archive calls it, so this repository upgrades the stock lnav in place onapt upgradeand a laterapt removeleaves nothing behind - ✅ The Official Static Build: upstream's own static musl binary, so it has no runtime dependencies at all and behaves the same on every suite
- ✅ Complete Package: the
lnavbinary and its man page, withopenssh-clientrecommended for remote logs andwl-clipboardorxclipsuggested for copying lines - ✅ Automatic Updates: packages updated within hours of upstream releases
- ✅ Two Architectures: amd64 and arm64 on every suite, so the same lnav runs on servers, laptops and ARM boards like the Raspberry Pi
- ✅ Multi-Distribution: works on Bookworm, Trixie, Forky and Sid
- ✅ Easy Maintenance: standard apt commands for updates
📦 Package Build Repository
The Debian packages are automatically built and maintained in this GitHub repository:
- 🪵 lnav-debian - Latest release builds
🔗 Related Packages
Also available from deb.griffo.io:
- lazydocker - A terminal UI for Docker, to find the container whose logs you need
- k9s - A terminal UI for Kubernetes clusters and their pods
- ripgrep - Fast recursive search, for grepping a whole log tree at once
- bottom - A system monitor for the terminal, for what the logs do not tell you
- fzf - A fuzzy finder for picking the log file to open
💝 Support This Project
If this repository saves you time and effort, please consider supporting it!