lnav - log file viewer for the terminal
Contents
Description
The Logfile Navigator, lnav, is a log file viewer for the terminal. Given a set of files/directories,
lnav will:
- decompress as needed;
- detect their format;
- merge the files together by time into a single view;
- tail the files, follow renames, find new files in directories;
- build an index of errors and warnings;
- pretty-print JSON-lines.
Examples
To load and follow the syslog file:
lnav
To load all of the files in /var/log:
lnav /var/log
To watch the output of make with timestamps prepended:
make 2>&1 | lnav -t
Key Bindings
? View/leave the online help text.
q Quit the program.
Management-Mode Options
-i Install the given format files in the $HOME/.lnav/formats/installed directory and exit.
-m Switch to the management command-line mode. This mode is used to work with lnav's configuration.
-C Check the configuration and exit. The log format files will be loaded and checked. Any files
given on the command-line will be loaded checked to make sure they match a log format.
Name
lnav - log file viewer for the terminal
Options
-h Print help and exit
-H Display the internal help text.
-I path
Add the given configuration directory to the search path.
-W Print warnings related to lnav's configuration.
-u Update formats installed from git repositories.
-d file
Write debug messages to the given file.
-V Print version information.
-r Recursively load files from the given directories.
-R Load older rotated log files as well.
-c cmd Execute a command after the files have been loaded.
-f path
Execute the commands in the given file.
-e cmd Execute a shell command-line.
-t Prepend timestamps to the lines of data being read in on the standard input.
-n Run without the curses UI. (headless mode)
-N Do not open the default syslog file if no files are given.
-q Quiet mode. Do not print the log messages after executing all of the commands.
Optionalarguments:
logfile1
The log files or directories to view. If a directory is given, all of the files in the directory
will be loaded.
Synopsis
lnav [options] [logfile1 logfile2 ...]
