mirror of
https://github.com/tstack/lnav
synced 2024-11-17 15:29:40 +00:00
[docs] some more writing
This commit is contained in:
parent
94ce0ffd83
commit
49368e1513
@ -137,8 +137,8 @@ results.
|
|||||||
:summarize col_0
|
:summarize col_0
|
||||||
|
|
||||||
|
|
||||||
Recognized Data
|
Recognized Data Types
|
||||||
---------------
|
---------------------
|
||||||
|
|
||||||
When searching for data to extract from log messages, **lnav** looks for the
|
When searching for data to extract from log messages, **lnav** looks for the
|
||||||
following set of patterns:
|
following set of patterns:
|
||||||
|
@ -82,7 +82,7 @@ Example format::
|
|||||||
"url" : "http://example.com/log-format.html",
|
"url" : "http://example.com/log-format.html",
|
||||||
"regex" : {
|
"regex" : {
|
||||||
"basic" : {
|
"basic" : {
|
||||||
"value" : "^"
|
"pattern" : "^(?<timestamp>\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z)>>(?<level>\\w+)>>(?<component>\\w+)>>(?<body>.*)$"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"level-field" : "level",
|
"level-field" : "level",
|
||||||
@ -98,7 +98,7 @@ Example format::
|
|||||||
},
|
},
|
||||||
"sample" : [
|
"sample" : [
|
||||||
{
|
{
|
||||||
"line" : ""
|
"line" : "2011-04-01T15:14:34.203Z>>ERROR>>core>>Shit's on fire yo!"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -107,4 +107,23 @@ Example format::
|
|||||||
Modifying an Existing Format
|
Modifying an Existing Format
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
|
When loading log formats from files, **lnav** will overlay any new data over
|
||||||
|
previously loaded data. This feature allows you to override existing value or
|
||||||
|
append new ones to the format configurations. For example, you can separately
|
||||||
|
add a new regex to the example log format given above by creating another file
|
||||||
|
with the following contents::
|
||||||
|
|
||||||
|
{
|
||||||
|
"example_log" : {
|
||||||
|
"regex" : {
|
||||||
|
"custom1" : {
|
||||||
|
"pattern" : "^(?<timestamp>\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z)<<(?<level>\\w+)--(?<component>\\w+)>>(?<body>.*)$"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sample" : [
|
||||||
|
{
|
||||||
|
"line" : "2011-04-01T15:14:34.203Z<<ERROR--core>>Shit's on fire yo!"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
.. _hotkeys:
|
||||||
|
|
||||||
Hotkey Reference
|
Hotkey Reference
|
||||||
================
|
================
|
||||||
|
|
||||||
@ -34,6 +36,8 @@ Hotkey Reference
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
This reference covers the keys used to control **lnav**.
|
||||||
|
|
||||||
Spatial Navigation
|
Spatial Navigation
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
@ -16,10 +16,9 @@ Contents:
|
|||||||
|
|
||||||
intro
|
intro
|
||||||
ui
|
ui
|
||||||
sessions
|
|
||||||
formats
|
formats
|
||||||
data
|
data
|
||||||
config
|
sessions
|
||||||
hotkeys
|
hotkeys
|
||||||
commands
|
commands
|
||||||
sqlext
|
sqlext
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Introduction
|
Introduction
|
||||||
============
|
============
|
||||||
|
|
||||||
The Log File Navigator, lnav, is an enhanced log file viewer that
|
The Log File Navigator, **lnav**, is an enhanced log file viewer that
|
||||||
takes advantage of any semantic information that can be gleaned from
|
takes advantage of any semantic information that can be gleaned from
|
||||||
the files being viewed, such as timestamps and log levels. Using this
|
the files being viewed, such as timestamps and log levels. Using this
|
||||||
extra semantic information, lnav can do things like interleaving
|
extra semantic information, lnav can do things like interleaving
|
||||||
@ -25,7 +25,7 @@ doing::
|
|||||||
Viewing Logs
|
Viewing Logs
|
||||||
------------
|
------------
|
||||||
|
|
||||||
The arguments to **lnav** are simply the log files or directories to be viewed.
|
The arguments to **lnav** are the log files or directories to be viewed.
|
||||||
For example, to view all of the CUPS logs on your system::
|
For example, to view all of the CUPS logs on your system::
|
||||||
|
|
||||||
$ lnav /var/log/cups
|
$ lnav /var/log/cups
|
||||||
@ -34,7 +34,7 @@ The formats of the logs are determined automatically and indexed on-the-fly.
|
|||||||
See :ref:`log-formats` for a listing of the predefined formats and how to
|
See :ref:`log-formats` for a listing of the predefined formats and how to
|
||||||
define your own.
|
define your own.
|
||||||
|
|
||||||
If no arguments are given, **lnav** will try to open the default syslog file on
|
If no arguments are given, **lnav** will try to open the syslog file on your
|
||||||
your system::
|
system::
|
||||||
|
|
||||||
$ lnav
|
$ lnav
|
||||||
|
BIN
docs/source/lnav-ui.png
Normal file
BIN
docs/source/lnav-ui.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 255 KiB |
@ -2,3 +2,17 @@
|
|||||||
Sessions
|
Sessions
|
||||||
========
|
========
|
||||||
|
|
||||||
|
Session information is stored automatically for the set of files that were
|
||||||
|
passed in on the command-line and reloaded the next time lnav is executed.
|
||||||
|
The information currently stored is:
|
||||||
|
|
||||||
|
* Position within the files being viewed.
|
||||||
|
* Active searches for each view.
|
||||||
|
* Any active log filters or highlights.
|
||||||
|
|
||||||
|
Bookmarks and log-time adjustments are stored separately on a per-file basis.
|
||||||
|
Note that the bookmarks are associated with files based on the content of the
|
||||||
|
first line of the file so that they are preserved even if the file has been
|
||||||
|
moved from its current location.
|
||||||
|
|
||||||
|
Session data is stored in the "~/.lnav" directory.
|
||||||
|
@ -2,21 +2,28 @@
|
|||||||
User Interface
|
User Interface
|
||||||
==============
|
==============
|
||||||
|
|
||||||
The main part of the display shows the log lines from the files interleaved
|
The main part of the display shows the log messages from all files sorted by the
|
||||||
based on time-of-day. New lines are automatically loaded as they are appended
|
message time. Status bars at the top and bottom of the screen can given you an
|
||||||
to the files and, if you are viewing the bottom of the files, lnav will scroll
|
idea of where you are in the logs. And, the last line is used for entering
|
||||||
down to display the new lines, much like 'tail -f'.
|
commands. Navigation is controlled by a series of hotkeys, see :ref:`hotkeys`
|
||||||
|
for more information.
|
||||||
|
|
||||||
On color displays, the lines will be highlighted as follows:
|
.. figure:: lnav-ui.png
|
||||||
|
:align: center
|
||||||
|
:alt: Screenshot showing syslog messages.
|
||||||
|
|
||||||
|
Screenshot of **lnav** viewing syslog messages.
|
||||||
|
|
||||||
|
On color displays, the log messages will be highlighted as follows:
|
||||||
|
|
||||||
* Errors will be colored in red;
|
* Errors will be colored in red;
|
||||||
* warnings will be yellow;
|
* warnings will be yellow;
|
||||||
boundaries between days will be underlined; and
|
|
||||||
* various color highlights will be applied to: IP addresses, SQL keywords,
|
* various color highlights will be applied to: IP addresses, SQL keywords,
|
||||||
XML tags, file and line numbers in Java backtraces, and quoted strings.
|
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).
|
||||||
|
|
||||||
To give you an idea of where you are in the file spatially, the right
|
The right side of the display has a proportionally sized 'scrollbar' that
|
||||||
side of the display has a proportionally sized 'scrollbar' that
|
|
||||||
indicates your current position in the file.
|
indicates your current position in the file.
|
||||||
|
|
||||||
Above and below the main body are status lines that display:
|
Above and below the main body are status lines that display:
|
||||||
@ -27,7 +34,7 @@ Above and below the main body are status lines that display:
|
|||||||
* the current view;
|
* the current view;
|
||||||
* the line number for the top line in the display;
|
* the line number for the top line in the display;
|
||||||
* the total number of warnings and errors;
|
* the total number of warnings and errors;
|
||||||
* the number of search hits, which updates as more are found; and
|
* the number of search hits; and
|
||||||
* the number of lines not displayed because of filtering.
|
* the number of lines not displayed because of filtering.
|
||||||
|
|
||||||
Finally, the last line on the display is where you can enter search
|
Finally, the last line on the display is where you can enter search
|
||||||
|
Loading…
Reference in New Issue
Block a user