From ae08c12aa09c7f4a4d529e51c648dcf3acf5473b Mon Sep 17 00:00:00 2001 From: Timothy Stack Date: Thu, 2 Jul 2020 15:04:08 -0700 Subject: [PATCH] [docs] some updates --- docs/source/cli.rst | 16 +++++++++--- docs/source/howitworks.rst | 6 +++++ docs/source/index.rst | 2 ++ docs/source/usage.rst | 50 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 docs/source/howitworks.rst create mode 100644 docs/source/usage.rst diff --git a/docs/source/cli.rst b/docs/source/cli.rst index c68ea9aa..8d50cbcd 100644 --- a/docs/source/cli.rst +++ b/docs/source/cli.rst @@ -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` or +:ref:`SQL queries`. + -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 diff --git a/docs/source/howitworks.rst b/docs/source/howitworks.rst new file mode 100644 index 00000000..abe84ab6 --- /dev/null +++ b/docs/source/howitworks.rst @@ -0,0 +1,6 @@ + +.. _howitworks: + +How It Works +============ + diff --git a/docs/source/index.rst b/docs/source/index.rst index b00be31f..38df35a2 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -15,6 +15,8 @@ Contents: :maxdepth: 2 intro + usage + howitworks cli ui hotkeys diff --git a/docs/source/usage.rst b/docs/source/usage.rst new file mode 100644 index 00000000..66ee0302 --- /dev/null +++ b/docs/source/usage.rst @@ -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` 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 `_ 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 +------------- + +