[docs] some updates

This commit is contained in:
Timothy Stack 2020-07-02 15:04:08 -07:00
parent 4f9ff532fa
commit ae08c12aa0
4 changed files with 71 additions and 3 deletions

View File

@ -4,10 +4,20 @@
Command Line Interface
======================
The following options can be used when starting **lnav**. There are not
many flags because the majority of the functionality is accessed using
the :code:`-c` option to execute :ref:`commands<commands>` or
:ref:`SQL queries<sql-ext>`.
-h Print these command-line options and exit.
-H Start lnav and switch to the help view.
-C Check the configuration for any errors and exit.
-c Execute the given command. This option can be given multiple times.
-C Check the given files against the configuration, report any errors, and
exit. This option can be helpful for validating that a log format is
well-formed.
-c cmd Execute the given lnav command, SQL query, or lnav script. The
argument must be prefixed with the character used to enter the prompt
to distinguish between the different types (i.e. ':', ';', '|').
This option can be given multiple times.
-f path Execute the given command file. This option can be given multiple times.
-I path Add a configuration directory.
-i Install the format files in the :file:`.lnav/formats/` directory.
@ -21,7 +31,7 @@ Command Line Interface
-t Prepend timestamps to the lines of data being read in on the standard
input.
-w path Write the contents of the standard input to this file.
-V Print the version of lnav
-V Print the version of lnav.
-q Do not print the log messages after executing all of the commands.
Examples

View File

@ -0,0 +1,6 @@
.. _howitworks:
How It Works
============

View File

@ -15,6 +15,8 @@ Contents:
:maxdepth: 2
intro
usage
howitworks
cli
ui
hotkeys

50
docs/source/usage.rst Normal file
View File

@ -0,0 +1,50 @@
.. include:: kbd.rst
.. _usage:
Usage
=====
This chapter contains an overview of how to make use of **lnav**.
Viewing Files
-------------
The files to view in **lnav** can be listed on the command-line or passed to the
:ref:`:open<open>` command. If the path is a directory, all of the files in the
directory will be opened and the directory will be monitored for files to be added
or removed. A
`glob pattern <https://en.wikipedia.org/wiki/Glob_(programming)>`_ can also be
used to watch for files that match the pattern. The files that are found will be
scanned to identify their file format. Files that match a log format will be
collated and displayed in the LOG view. Plain text files can be viewed in the
TEXT view, which can be accessed by pressing |ks| t |ke|.
Log message parsing is the base that many of the other features mentioned in this
chapter are built upon. Messages are matched against regular expressions defined
in log format definitions. When **lnav** first opens a file, it will cycle through
all of the known formats and try to match the beginning lines in the file against
the patterns. When a match is found,
Searching
---------
Filtering
---------
To reduce the amount of noise in a log file, **lnav** can filter out log messages
based on the following criteria:
* Regular expression match
* Time
* Log level
Search Tables
-------------