lnav/docs/source/ui.rst

105 lines
3.5 KiB
ReStructuredText
Raw Normal View History

.. _ui:
2013-07-27 18:04:43 +00:00
User Interface
==============
2022-08-07 17:00:34 +00:00
The **lnav** TUI displays the content of the current "view" in the middle,
with status bars above and below, and the interactive prompt as the last line.
2013-07-29 00:05:09 +00:00
2013-08-26 14:20:01 +00:00
.. figure:: lnav-ui.png
:align: center
2022-08-07 17:00:34 +00:00
:alt: Screenshot of lnav showing a mix of syslog and web access_log messages.
2013-08-26 14:20:01 +00:00
Screenshot of **lnav** viewing syslog messages.
2022-08-07 17:00:34 +00:00
The default view shows the log messages from the log files that have been
loaded. There are other views for displaying content like plaintext files
and SQL results. The :ref:`ui_views` section describes the characteristics of
each view in more detail. You can switch to the different views using the
hotkeys described in the :ref:`hotkeys_display` section or by pressing
:kbd:`ENTER` to activate the breadcrumb bar, moving to the first crumb, and
then selecting the desired view. You can switch back to the previous view by
pressing :kbd:`q`. You can switch forward to the new view by pressing
:kbd:`a`.
2013-07-29 00:05:09 +00:00
2013-08-26 14:20:01 +00:00
The right side of the display has a proportionally sized 'scrollbar' that
2014-03-28 13:55:24 +00:00
shows:
2022-08-07 17:00:34 +00:00
* the current position in the file;
* the locations of errors/warnings in the log files by using red or yellow
2014-03-28 13:55:24 +00:00
coloring;
* the locations of search hits by using a tick-mark pointing to the left;
* the locations of bookmarks by using a tick-mark pointing to the right.
2013-07-29 00:05:09 +00:00
Above and below the main body are status lines that display:
* the current time;
* the name of the file the top line was pulled from;
* the log format for the top line;
* the current view;
* the line number for the top line in the display;
* the current search hit, the total number of hits, and the search term;
2018-11-11 06:55:08 +00:00
If the view supports filtering, there will be a status line showing the
following:
2020-05-07 14:08:59 +00:00
* the number of enabled filters and the total number of filters;
* the number of lines that are **not** displayed because of filtering.
2018-11-11 06:55:08 +00:00
To edit the filters, you can press TAB to change the focus from the main
view to the filter editor. The editor allows you to create, enable/disable,
and delete filters easily.
2013-07-29 00:05:09 +00:00
Finally, the last line on the display is where you can enter search
patterns and execute internal commands, such as converting a
unix-timestamp into a human-readable date. The command-line is by
the readline library, so the usual set of keyboard shortcuts can
be used.
The body of the display is also used to display other content, such
as: the help file, histograms of the log messages over time, and
SQL results. The views are organized into a stack so that any time
you activate a new view with a key press or command, the new view
is pushed onto the stack. Pressing the same key again will pop the
view off of the stack and return you to the previous view. Note
that you can always use 'q' to pop the top view off of the stack.
2022-08-07 17:00:34 +00:00
.. _ui_views:
Views
-----
LOG
^^^
The log view displays the log messages from any loaded log files in time
order.
On color displays, the log messages will be highlighted as follows:
* Errors will be colored in red;
* warnings will be yellow;
* search hits are reverse video;
* various color highlights will be applied to: IP addresses, SQL keywords,
XML tags, file and line numbers in Java backtraces, and quoted strings;
* "identifiers" in the messages will be randomly assigned colors based on their
content (works best on "xterm-256color" terminals).
.. note::
If the coloring is too much for your tastes, you can change to the
"grayscale" theme by entering the following command:
.. code-block:: lnav
:config /ui/theme grayscale
DB
^^
HELP
^^^^
HIST
^^^^