[docs] update the docs for recent changes

This commit is contained in:
Timothy Stack 2015-07-19 21:38:37 -07:00
parent 27bb9bb2ee
commit 010131aaba
3 changed files with 21 additions and 3 deletions

View File

@ -53,6 +53,10 @@ fields:
The `PCRE <http://www.pcre.org>`_ library is used by **lnav** to do all
regular expression matching.
:module-format: If true, this regex will only be used to parse message
bodies for formats that can act as containers, such as syslog. Default:
false.
:json: True if each log line is JSON-encoded.
:line-format: An array that specifies the text format for JSON-encoded
@ -86,6 +90,15 @@ fields:
:body-field: The name of the field that contains the main body of the
message. Defaults to "body".
:module-field: The name of the field that contains the module identifier
that distinguishes messages from one log source from another. This field
should be used if this message format can act as a container for other
types of log messages. For example, an Apache access log can be sent to
syslog instead of written to a file. In this case, **lnav** will parse
the syslog message and then separately parse the body of the message to
determine the "sub" format. This module identifier is used to help
**lnav** quickly identify the format to use when parsing message bodies.
:level: A mapping of error levels to regular expressions. During scanning
the contents of the capture group specified by *level-field* will be
checked against each of these regexes. Once a match is found, the log
@ -93,6 +106,11 @@ fields:
in order of severity, are: **fatal**, **critical**, **error**,
**warning**, **stats**, **info**, **debug**, **debug2-5**, **trace**.
:multiline: If false, **lnav** will consider any log lines that do not
match one of the message patterns to be in error when checking files with
the '-C' option. This flag will not affect normal viewing operation.
Default: true.
:value: This object contains the definitions for the values captured by the
regexes.

View File

@ -806,7 +806,7 @@
"error" : "(?:(?:(?<![a-zA-Z]))(?:(?i)error(?:s)?)(?:(?![a-zA-Z]))|failed|failure)",
"warning" : "(?:(?:(?i)warn)|not responding|init: cannot execute)"
},
"module-identifier" : "log_procname",
"module-field" : "log_procname",
"value" : {
"log_hostname" : {
"kind" : "string",

View File

@ -172,7 +172,7 @@ static int read_format_field(yajlpp_parse_context *ypc, const unsigned char *str
elf->elf_body_field = intern_string::lookup(value);
else if (field_name == "timestamp-format")
elf->lf_timestamp_format.push_back(intern_string::lookup(value)->get());
else if (field_name == "module-identifier") {
else if (field_name == "module-field") {
elf->elf_module_id_field = intern_string::lookup(value);
elf->elf_container = true;
}
@ -406,7 +406,7 @@ static struct json_path_handler format_handlers[] = {
.add_cb(read_format_int),
json_path_handler("^/\\w+/(file-pattern|level-field|timestamp-field|"
"body-field|url|url#|title|description|"
"timestamp-format#|module-identifier)$",
"timestamp-format#|module-field)$",
read_format_field),
json_path_handler("^/\\w+/level/"
"(trace|debug\\d*|info|stats|warning|error|critical|fatal)$",