diff options
Diffstat (limited to '')
-rw-r--r-- | docs/schemas/format-v1.schema.json | 260 |
1 files changed, 240 insertions, 20 deletions
diff --git a/docs/schemas/format-v1.schema.json b/docs/schemas/format-v1.schema.json index fe781f9..d96a285 100644 --- a/docs/schemas/format-v1.schema.json +++ b/docs/schemas/format-v1.schema.json @@ -10,7 +10,7 @@ } }, "patternProperties": { - "(\\w+)": { + "^(\\w+)$": { "description": "The definition of a log file format.", "title": "/<format_name>", "type": "object", @@ -20,7 +20,7 @@ "title": "/<format_name>/regex", "type": "object", "patternProperties": { - "([^/]+)": { + "^(.+)$": { "description": "The set of patterns used to match log messages", "title": "/<format_name>/regex/<pattern_name>", "type": "object", @@ -75,16 +75,50 @@ "description": "A regular expression that restricts this format to log files with a matching name", "type": "string" }, - "mime-types": { - "title": "/<format_name>/mime-types", - "description": "A list of mime-types this format should be used for", - "type": "array", - "items": { - "type": "string", - "enum": [ - "application/vnd.tcpdump.pcap" - ] - } + "converter": { + "description": "Describes how the file format can be detected and converted to a log that can be understood by lnav", + "title": "/<format_name>/converter", + "type": "object", + "properties": { + "type": { + "title": "/<format_name>/converter/type", + "description": "The MIME type", + "type": "string" + }, + "header": { + "description": "File header detection definitions", + "title": "/<format_name>/converter/header", + "type": "object", + "properties": { + "expr": { + "description": "The expressions used to check if a file header matches this file format", + "title": "/<format_name>/converter/header/expr", + "type": "object", + "patternProperties": { + "^(\\w+)$": { + "title": "/<format_name>/converter/header/expr/<header_expr_name>", + "description": "SQLite expression", + "type": "string" + } + }, + "additionalProperties": false + }, + "size": { + "title": "/<format_name>/converter/header/size", + "description": "The minimum size required for this header type", + "type": "integer" + } + }, + "additionalProperties": false + }, + "command": { + "title": "/<format_name>/converter/command", + "description": "The script used to convert the file", + "type": "string", + "pattern": "[\\w\\.\\-]+" + } + }, + "additionalProperties": false }, "level-field": { "title": "/<format_name>/level-field", @@ -165,6 +199,123 @@ "description": "The name of the operation-id field in the log message pattern", "type": "string" }, + "opid": { + "description": "Definitions related to operations found in logs", + "title": "/<format_name>/opid", + "type": "object", + "properties": { + "subid": { + "title": "/<format_name>/opid/subid", + "description": "The field that holds the ID for a sub-operation", + "type": "string" + }, + "description": { + "description": "Define how to construct a description of an operation", + "title": "/<format_name>/opid/description", + "type": "object", + "patternProperties": { + "^([\\w\\.\\-]+)$": { + "description": "A type of description for this operation", + "title": "/<format_name>/opid/description/<opid_descriptor>", + "type": "object", + "properties": { + "format": { + "description": "Defines the elements of this operation description", + "title": "/<format_name>/opid/description/<opid_descriptor>/format", + "type": "array", + "items": { + "type": "object", + "properties": { + "field": { + "title": "/<format_name>/opid/description/<opid_descriptor>/format/field", + "description": "The field to include in the operation description", + "type": "string" + }, + "extractor": { + "title": "/<format_name>/opid/description/<opid_descriptor>/format/extractor", + "description": "The regex used to extract content for the operation description", + "type": "string" + }, + "prefix": { + "title": "/<format_name>/opid/description/<opid_descriptor>/format/prefix", + "description": "A string to prepend to this field in the description", + "type": "string" + }, + "suffix": { + "title": "/<format_name>/opid/description/<opid_descriptor>/format/suffix", + "description": "A string to append to this field in the description", + "type": "string" + }, + "joiner": { + "title": "/<format_name>/opid/description/<opid_descriptor>/format/joiner", + "description": "A string to insert between instances of this field when the field is found more than once", + "type": "string" + } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "sub-description": { + "description": "Define how to construct a description of a sub-operation", + "title": "/<format_name>/opid/sub-description", + "type": "object", + "patternProperties": { + "^([\\w\\.\\-]+)$": { + "description": "A type of description for this sub-operation", + "title": "/<format_name>/opid/sub-description/<subid_descriptor>", + "type": "object", + "properties": { + "format": { + "description": "Defines the elements of this operation description", + "title": "/<format_name>/opid/sub-description/<subid_descriptor>/format", + "type": "array", + "items": { + "type": "object", + "properties": { + "field": { + "title": "/<format_name>/opid/sub-description/<subid_descriptor>/format/field", + "description": "The field to include in the operation description", + "type": "string" + }, + "extractor": { + "title": "/<format_name>/opid/sub-description/<subid_descriptor>/format/extractor", + "description": "The regex used to extract content for the operation description", + "type": "string" + }, + "prefix": { + "title": "/<format_name>/opid/sub-description/<subid_descriptor>/format/prefix", + "description": "A string to prepend to this field in the description", + "type": "string" + }, + "suffix": { + "title": "/<format_name>/opid/sub-description/<subid_descriptor>/format/suffix", + "description": "A string to append to this field in the description", + "type": "string" + }, + "joiner": { + "title": "/<format_name>/opid/sub-description/<subid_descriptor>/format/joiner", + "description": "A string to insert between instances of this field when the field is found more than once", + "type": "string" + } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, "ordered-by-time": { "title": "/<format_name>/ordered-by-time", "description": "Indicates that the order of messages in the file is time-based.", @@ -175,7 +326,7 @@ "title": "/<format_name>/level", "type": "object", "patternProperties": { - "(trace|debug[2345]?|info|stats|notice|warning|error|critical|fatal)": { + "^(trace|debug[2345]?|info|stats|notice|warning|error|critical|fatal)$": { "title": "/<format_name>/level/<level>", "description": "The regular expression used to match the log text for this level. For JSON logs with numeric levels, this should be the number for the corresponding level.", "type": [ @@ -191,7 +342,7 @@ "title": "/<format_name>/value", "type": "object", "patternProperties": { - "([^/]+)": { + "^(.+)$": { "description": "The set of values captured by the log message patterns", "title": "/<format_name>/value/<value_name>", "type": "object", @@ -231,7 +382,7 @@ "title": "/<format_name>/value/<value_name>/unit/scaling-factor", "type": "object", "patternProperties": { - "([^/]+)": { + "^(.+)$": { "title": "/<format_name>/value/<value_name>/unit/scaling-factor/<scale>", "type": "object", "properties": { @@ -304,7 +455,7 @@ "title": "/<format_name>/tags", "type": "object", "patternProperties": { - "([\\w:;\\._\\-]+)": { + "^([\\w:;\\._\\-]+)$": { "description": "The name of the tag to apply", "title": "/<format_name>/tags/<tag_name>", "type": "object", @@ -367,11 +518,79 @@ }, "additionalProperties": false }, + "partitions": { + "description": "The partitions to automatically apply to log messages", + "title": "/<format_name>/partitions", + "type": "object", + "patternProperties": { + "^([\\w:;\\._\\-]+)$": { + "description": "The type of partition to apply", + "title": "/<format_name>/partitions/<partition_type>", + "type": "object", + "properties": { + "paths": { + "description": "Restrict partitioning to the given paths", + "title": "/<format_name>/partitions/<partition_type>/paths", + "type": "array", + "items": { + "type": "object", + "properties": { + "glob": { + "title": "/<format_name>/partitions/<partition_type>/paths/glob", + "description": "The glob to match against file paths", + "type": "string", + "examples": [ + "*/system.log*" + ] + } + }, + "additionalProperties": false + } + }, + "pattern": { + "title": "/<format_name>/partitions/<partition_type>/pattern", + "description": "The regular expression to match against the body of the log message", + "type": "string", + "examples": [ + "\\w+ is down" + ] + }, + "description": { + "title": "/<format_name>/partitions/<partition_type>/description", + "description": "A description of this partition", + "type": "string" + }, + "level": { + "title": "/<format_name>/partitions/<partition_type>/level", + "description": "Constrain hits to log messages with this level", + "type": "string", + "enum": [ + "trace", + "debug5", + "debug4", + "debug3", + "debug2", + "debug", + "info", + "stats", + "notice", + "warning", + "error", + "critical", + "fatal" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, "action": { "title": "/<format_name>/action", "type": "object", "patternProperties": { - "(\\w+)": { + "^(\\w+)$": { "title": "/<format_name>/action/<action_name>", "type": [ "string", @@ -499,7 +718,8 @@ "enum": [ "abbrev", "truncate", - "dot-dot" + "dot-dot", + "last-word" ] }, "text-transform": { @@ -532,7 +752,7 @@ "title": "/<format_name>/search-table", "type": "object", "patternProperties": { - "(\\w+)": { + "^(\\w+)$": { "description": "The set of search tables to be automatically defined", "title": "/<format_name>/search-table/<table_name>", "type": "object", @@ -578,7 +798,7 @@ "title": "/<format_name>/highlights", "type": "object", "patternProperties": { - "([^/]+)": { + "^(.+)$": { "description": "The definition of a highlight", "title": "/<format_name>/highlights/<highlight_name>", "type": "object", |