lnav
Log file navigator
lnav is a terminal-based log file viewer that automatically detects formats, merges multiple logs into one time-sorted view, and lets you search, filter, and run SQL queries against your logs.
lnav (the Log File Navigator) is a terminal-based viewer for reading and analyzing log files. Instead of using basic command-line tools like tail or grep, which treat log files as plain text and have no understanding of what a log message means, lnav reads the structure of log files and presents them in a more useful way. You point it at one or more files or directories, and it automatically detects the log format, decompresses compressed files, merges everything into a single time-sorted view, and highlights errors and warnings in color.
The interactive display lets you jump directly from one error to the next with a single key press, which is much faster than scrolling through thousands of lines looking for problems. You can search using regular expressions, filter out uninteresting lines, and pretty-print structured data like JSON. A histogram view shows you at a glance how many log messages appeared at each point in time, making it easier to spot when an incident started. You can also run SQL queries against the log data directly from inside lnav, treating log lines as rows in a database table.
One of the practical advantages over standard tools is how it handles multiple files: it merges syslog, web access logs, and application logs into one chronological stream, so you can see what was happening across different parts of your system at the same moment. It also handles compressed files and follows files as they grow in real time.
lnav runs on Linux, macOS, and Windows. Pre-built binaries are available from the releases page, and it can also be installed through Homebrew on Mac. The project offers an SSH-accessible demo server so you can try the tool before installing it locally. It is written in C++ and has been in active development for many years.
Where it fits
- View and search across multiple log files merged into one chronological timeline in real time
- Jump between errors and warnings in large log files with a single key press instead of scrolling
- Run SQL queries against log data directly inside the viewer to find patterns and counts
- Monitor live log files as they grow and see a histogram of message volume over time