1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
|
[1m[31m✘ error[0m: invalid value for option “[1m/bad_json_log/line-format#/timestamp-format[0m”
[1m[31mreason[0m: empty values are not allowed
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-json-format/format.json[0m:11
[36m | [0m[37m[40m "timestamp-format": "" [0m
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
[1m/bad_json_log/line-format#/timestamp-format[0m [4m<string>[0m
[1mDescription[0m
The strftime(3) format for this field
[33m⚠ warning[0m: unexpected value for property “[1m/bad-name-log/title[0m”
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-name/format.json[0m:4
[36m | [0m[37m[40m "title": "bad-format", [0m
[36m =[0m [36mhelp[0m: [1mAvailable Properties[0m
[1m$schema[0m [4mThe URI of the schema for this file[0m
[1m(\w+)[0m[1m/[0m
[33m⚠ warning[0m: unexpected value for property “[1m/bad-name-log/description[0m”
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-name/format.json[0m:5
[36m | [0m[37m[40m "description": "Log format with a name that has invalid characters",[0m
[36m =[0m [36mhelp[0m: [1mAvailable Properties[0m
[1m$schema[0m [4mThe URI of the schema for this file[0m
[1m(\w+)[0m[1m/[0m
[33m⚠ warning[0m: unexpected value for property “[1m/bad-name-log/json[0m”
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-name/format.json[0m:6
[36m | [0m[37m[40m "json": true [0m
[36m =[0m [36mhelp[0m: [1mAvailable Properties[0m
[1m$schema[0m [4mThe URI of the schema for this file[0m
[1m(\w+)[0m[1m/[0m
[1m[31m✘ error[0m: “invalid(abc” is not a valid regular expression
[1m[31mreason[0m: missing closing parenthesis
[36m --> [0m[1m/invalid_props_log/tags/badtag3/pattern[0m
[36m | [0m[37m[40minvalid[0m[1m[7m[32m[40m([0m[37m[40mabc [0m
[36m | [0m[37m[40m [0m[1m[31m[40m^ [0m[1m[31m[40mmissing closing parenthesis[0m
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:36
[36m | [0m[37m[40m "pattern": "invalid(abc"[0m
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
[1m/invalid_props_log/tags/badtag3/pattern[0m [4m<regex>[0m
[1mDescription[0m
The regular expression to match against the body of the log message
[1mExample[0m
\w+ is down
[1m[31m✘ error[0m: “abc(def” is not a valid regular expression
[1m[31mreason[0m: missing closing parenthesis
[36m --> [0m[1m/invalid_props_log/search-table/bad_table_regex/pattern[0m
[36m | [0m[37m[40mabc[0m[1m[7m[32m[40m([0m[37m[40mdef [0m
[36m | [0m[37m[40m [0m[1m[31m[40m^ [0m[1m[31m[40mmissing closing parenthesis[0m[37m[40m [0m
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:41
[36m | [0m[37m[40m "pattern": "abc(def" [0m
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
[1m/invalid_props_log/search-table/bad_table_regex/pattern[0m [4m<regex>[0m
[1mDescription[0m
The regular expression for this search table.
[1m[31m✘ error[0m: “^(?<timestamp>\d+: (?<body>.*)$” is not a valid regular expression
[1m[31mreason[0m: missing closing parenthesis
[36m --> [0m[1m/bad_regex_log/regex/std/pattern[0m
[36m | [0m[1m[36m[40m^[0m[1m[7m[32m[40m([0m[1m[32m[40m?[0m[1m[36m[40m<[0m[37m[40mtimestamp>[0m[1m[37m[40m\d[0m[1m[36m[40m+[0m[37m[40m: [0m[1m[32m[40m([0m[1m[32m[40m?[0m[1m[36m[40m<[0m[37m[40mbody>[0m[1m[36m[40m.[0m[1m[36m[40m*[0m[1m[32m[40m)[0m[1m[36m[40m$[0m[37m[40m [0m
[36m | [0m[37m[40m [0m[1m[31m[40m^ [0m[1m[31m[40mmissing closing parenthesis[0m
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-regex/format.json[0m:6
[36m | [0m[37m[40m "pattern": "^(?<timestamp>\\d+: (?<body>.*)$"[0m
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
[1m/bad_regex_log/regex/std/pattern[0m [4m<message-regex>[0m
[1mDescription[0m
The regular expression to match a log message and capture fields.
[1m[31m✘ error[0m: “(foo” is not a valid regular expression
[1m[31mreason[0m: missing closing parenthesis
[36m --> [0m[1mpattern[0m
[36m | [0m[1m[7m[32m[40m([0m[37m[40mfoo [0m
[36m | [0m[37m[40m [0m[1m[31m[40m^ [0m[1m[31m[40mmissing closing parenthesis[0m[37m[40m [0m
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-regex/format.json[0m:13
[36m | [0m[37m[40m "error": "(foo" [0m
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
[1m/bad_regex_log/level/error[0m [4m<pattern|integer>[0m
[1mDescription[0m
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.
[1m[31m✘ error[0m: “abc(” is not a valid regular expression
[1m[31mreason[0m: missing closing parenthesis
[36m --> [0m[1m/bad_regex_log/highlights/foobar/pattern[0m
[36m | [0m[37m[40mabc[0m[1m[7m[32m[40m([0m[37m[40m [0m
[36m | [0m[37m[40m [0m[1m[31m[40m^ [0m[1m[31m[40mmissing closing parenthesis[0m[37m[40m [0m
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-regex/format.json[0m:25
[36m | [0m[37m[40m "pattern": "abc(" [0m
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
[1m/bad_regex_log/highlights/foobar/pattern[0m [4m<regex>[0m
[1mDescription[0m
A regular expression to highlight in logs of this format.
[33m⚠ warning[0m: format file is missing “[1m$schema[0m” property
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-regex/format.json[0m
[36m =[0m [36mnote[0m: the schema specifies the supported format version and can be used with editors to automatically validate the file
[36m =[0m [36mhelp[0m: add the following property to the top-level JSON object:
[37m[40m "$schema": "https://lnav.org/schemas/format-v1.schema.json",[0m
[1m[31m✘ error[0m: “foo” is not a valid value for option “[1m/bad_sample_log/value/pid/kind[0m”
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sample/format.json[0m:24
[36m | [0m[37m[40m "kind": "foo" [0m
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
[1m/bad_sample_log/value/pid/kind[0m [4m<data-type>[0m
[1mDescription[0m
The type of data in the field
[1mAllowed Values[0m
[1mstring[0m, [1minteger[0m, [1mfloat[0m, [1mboolean[0m, [1mjson[0m, [1mstruct[0m, [1mquoted[0m, [1mxml[0m
[1m[31m✘ error[0m: '[1mbad[0m' is not a supported log format $schema version
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-schema/format.json[0m:2
[36m | [0m[37m[40m "$schema": "bad" [0m
[36m =[0m [36mnote[0m: expecting one of the following $schema values:
[1m https://lnav.org/schemas/format-v1.schema.json[0m
[36m =[0m [36mhelp[0m: [1mProperty Synopsis[0m
[1m/$schema[0m [4mThe URI of the schema for this file[0m
[1mDescription[0m
Specifies the type of this file
[1m[31m✘ error[0m: SQL expression is invalid
[1m[31mreason[0m: unrecognized token: "'foobar"
[36m --> [0m[1m/bad_file_format1/converter/header/expr/default[0m
[36m | [0m[37m[40m:header[0m[37m[40m [0m[1m[36m[40mREGEXP[0m[37m[40m [0m[1m[7m[31m[40m'[0m[37m[40mfoobar [0m
[1m[31m✘ error[0m: A command is required when a converter is defined
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-file-format/format.json[0m:4
[36m =[0m [36mhelp[0m: The converter command transforms the file into a format that can be consumed by lnav
[1m[31m✘ error[0m: invalid line format element “[1m/bad_json_log/line-format/0/field[0m”
[1m[31mreason[0m: “” is not a defined value
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-json-format/format.json[0m:7
[1m[31m✘ error[0m: invalid pattern: “[1mincomplete-match[0m”
[1m[31mreason[0m: pattern does not match entire message
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-regex/format.json[0m:20
[36m | [0m[37m[40m1428634687123; foo [0m
[36m | [0m[37m[40m [0m[1m[31m[40m^ matched up to here[0m[37m[40m [0m
[36m =[0m [36mnote[0m: [1mincomplete-match[0m = [1m[36m^[0m[1m[32m([0m[1m[32m?[0m[1m[36m<[0mtimestamp>[1m\d[0m[1m[36m+[0m[1m[32m)[0m;
[36m =[0m [36mhelp[0m: update the regular expression to fully capture the sample message
[1m[31m✘ error[0m: invalid sample log message: "abc: foo"
[1m[31mreason[0m: unrecognized timestamp -- abc
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sample/format.json[0m:34
[36m =[0m [36mnote[0m: the following custom formats were tried:
abc
[36m^ [0m“[1m%i[0m”[36m matched up to here[0m
[36m =[0m [36mhelp[0m: If the timestamp format is not supported by default, you can add a custom format with the “[1mtimestamp-format[0m” property
[1m[31m✘ error[0m: invalid sample log message: "1428634687123| debug hello"
[1m[31mreason[0m: “[1mdebug[0m” does not match the expected level of “[1minfo[0m”
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sample/format.json[0m:37
[36m =[0m [36mnote[0m: matched regex = [1mwith-level[0m
captured level = “debug”
level regular expression match results:
[1m/bad_sample_log/level/debug[0m = debug
debug
[36m^[0m[36m---[0m[36m^[0m
[1m/bad_sample_log/level/info[0m = info
[33mno match[0m
[36m =[0m [36mhelp[0m: Level regexes are not anchored to the start/end of the string. Prepend “[1m^[0m” to the expression to match from the start of the string and append “[1m$[0m” to match up to the end of the string.
[1m[31m✘ error[0m: invalid pattern: “[1mwith-level[0m”
[1m[31mreason[0m: pattern does not match entire multiline sample message
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sample/format.json[0m:41
[36m =[0m [36mnote[0m: [1mwith-level[0m = [1m[36m^[0m[1m[32m([0m[1m[32m?[0m[1m[36m<[0mtimestamp>[1m\d[0m[1m[36m+[0m[1m[32m)[0m\| [1m[32m([0m[1m[32m?[0m[1m[36m<[0mlevel>[1m\w[0m[1m[36m+[0m[1m[32m)[0m [1m[32m([0m[1m[32m?[0m[1m[36m<[0mbody>[1m\w[0m[1m[36m+[0m[1m[32m)[0m[1m[36m$[0m
[36m =[0m [36mhelp[0m: use “.*” to match new-lines
[1m[31m✘ error[0m: invalid sample log message: "1428634687123; foo bar"
[1m[31mreason[0m: sample does not match any patterns
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sample/format.json[0m:45
[36m =[0m [36mnote[0m: the following shows how each pattern matched this sample:
[37m[40m1428634687123; foo bar[0m
[36m^ [0m[1mbad-time[0m[36m matched up to here[0m
[36m^ [0m[1msemi[0m[36m matched up to here[0m
[36m^ [0m[1mstd[0m[36m matched up to here[0m
[36m^ [0m[1mwith-level[0m[36m matched up to here[0m
[36m =[0m [36mnote[0m: [1mbad-time [0m = “[1m[36m^[0m[1m[32m([0m[1m[32m?[0m[1m[36m<[0mtimestamp>[1m\w[0m[1m[36m+[0m[1m[32m)[0m: [1m[32m([0m[1m[32m?[0m[1m[36m<[0mbody>[1m\w[0m[1m[36m+[0m[1m[32m)[0m[1m[36m$[0m”
[1msemi [0m = “[1m[36m^[0m[1m[32m([0m[1m[32m?[0m[1m[36m<[0mtimestamp>[1m\d[0m[1m[36m+[0m[1m[32m)[0m; [1m[32m([0m[1m[32m?[0m[1m[36m<[0mbody>[1m\w[0m[1m[36m+[0m[1m[32m)[0m[1m[36m$[0m”
[1mstd [0m = “[1m[36m^[0m[1m[32m([0m[1m[32m?[0m[1m[36m<[0mtimestamp>[1m\d[0m[1m[36m+[0m[1m[32m)[0m: [1m[32m([0m[1m[32m?[0m[1m[36m<[0mpid>[1m\w[0m[1m[36m+[0m[1m[32m)[0m [1m[32m([0m[1m[32m?[0m[1m[36m<[0mbody>[1m[36m.[0m[1m[36m*[0m[1m[32m)[0m[1m[36m$[0m”
[1mwith-level[0m = “[1m[36m^[0m[1m[32m([0m[1m[32m?[0m[1m[36m<[0mtimestamp>[1m\d[0m[1m[36m+[0m[1m[32m)[0m\| [1m[32m([0m[1m[32m?[0m[1m[36m<[0mlevel>[1m\w[0m[1m[36m+[0m[1m[32m)[0m [1m[32m([0m[1m[32m?[0m[1m[36m<[0mbody>[1m\w[0m[1m[36m+[0m[1m[32m)[0m[1m[36m$[0m”
[33m⚠ warning[0m: invalid pattern: “[1m/bad_sample_log/regex/semi[0m”
[33mreason[0m: pattern does not match any samples
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sample/format.json[0m:10
[36m =[0m [36mhelp[0m: every pattern should have at least one sample that it matches
[33m⚠ warning[0m: invalid pattern: “[1m/bad_sample_log/regex/std[0m”
[33mreason[0m: pattern does not match any samples
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sample/format.json[0m:7
[36m =[0m [36mhelp[0m: every pattern should have at least one sample that it matches
[1m[31m✘ error[0m: invalid pattern: “[1m/invalid_props_log/regex/std[0m”
[1m[31mreason[0m: no timestamp capture found in the pattern
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:4
[36m =[0m [36mhelp[0m: all log messages need a timestamp
[33m⚠ warning[0m: invalid value “[1m/invalid_props_log/value/non-existent[0m”
[33mreason[0m: no patterns have a capture named “non-existent”
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:4
[36m =[0m [36mnote[0m: the following captures are available:
[1mbody[0m, [1mpid[0m, [1mtimestamp[0m
[36m =[0m [36mhelp[0m: values are populated from captures in patterns, so at least one pattern must have a capture with this value name
[1m[31m✘ error[0m: invalid tag definition “[1m/invalid_props_log/tags/badtag[0m”
[1m[31mreason[0m: tag definitions must have a non-empty pattern
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:4
[1m[31m✘ error[0m: invalid tag definition “[1m/invalid_props_log/tags/badtag2[0m”
[1m[31mreason[0m: tag definitions must have a non-empty pattern
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:4
[1m[31m✘ error[0m: invalid tag definition “[1m/invalid_props_log/tags/badtag3[0m”
[1m[31mreason[0m: tag definitions must have a non-empty pattern
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:4
[1m[31m✘ error[0m: “[1minvalid_props_log[0m” is not a valid log format
[1m[31mreason[0m: “[1msubsecond-unit[0m” must be set when “[1msubsecond-field[0m” is used
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:4
[1m[31m✘ error[0m: invalid value for property “[1m/invalid_props_log/timestamp-field[0m”
[1m[31mreason[0m: “ts” was not found in the pattern at [1m/invalid_props_log/regex/std[0m
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:4
[36m =[0m [36mnote[0m: the following captures are available:
[1mbody[0m, [1mpid[0m, [1mtimestamp[0m
[1m[31m✘ error[0m: “not a color” is not a valid color value for property “[1m/invalid_props_log/highlights/hl1/color[0m”
[1m[31mreason[0m: Unknown color: 'not a color'. See https://jonasjacek.github.io/colors/ for a list of supported color names
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:24
[1m[31m✘ error[0m: “also not a color” is not a valid color value for property “[1m/invalid_props_log/highlights/hl1/background-color[0m”
[1m[31mreason[0m: Unknown color: 'also not a color'. See https://jonasjacek.github.io/colors/ for a list of supported color names
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-properties/format.json[0m:25
[1m[31m✘ error[0m: “[1mno_regexes_log[0m” is not a valid log format
[1m[31mreason[0m: no regexes specified
[36m --> [0m[1m{test_dir}/bad-config/formats/no-regexes/format.json[0m:4
[1m[31m✘ error[0m: “[1mno_regexes_log[0m” is not a valid log format
[1m[31mreason[0m: log message samples must be included in a format definition
[36m --> [0m[1m{test_dir}/bad-config/formats/no-regexes/format.json[0m:4
[1m[31m✘ error[0m: “[1mno_sample_log[0m” is not a valid log format
[1m[31mreason[0m: log message samples must be included in a format definition
[36m --> [0m[1m{test_dir}/bad-config/formats/no-samples/format.json[0m:4
[1m[31m✘ error[0m: invalid sample log message: "gitea | 2023/09/24 22:15:55 cmd/web.go:223:runWeb() [I] Starting Gitea on PID: 7"
[1m[31mreason[0m: timestamp was not captured
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-no-tscap/format.json[0m:25
[36m =[0m [36mhelp[0m: A timestamp needs to be captured in order for a line to be recognized as a log message
[1m[31m✘ error[0m: failed to compile SQL statement
[1m[31mreason[0m: near "TALE": syntax error
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sql/init.sql[0m:4
[36m | [0m[32m[40m-- comment test [0m
[36m | [0m[1m[36m[40mCREATE[0m[37m[40m [0m[37m[40mTALE[0m[37m[40m [0m[1m[37m[40minvalid[0m[1m[37m[40m [0m[37m[40m([0m[37m[40mx[0m[37m[40m [0m[37m[40my[0m[37m[40m [0m[37m[40mz[0m[37m[40m); [0m
[36m | [0m[37m[40m [0m[36m[40m^ [0m[1m[31m[40mnear "TALE": syntax error[0m[37m[40m [0m
[1m[31m✘ error[0m: failed to execute SQL statement
[1m[31mreason[0m: [1m[31m✘ error[0m: “abc(” is not a valid regular expression
[1m[31m | [0m [1m[31mreason[0m: missing closing parenthesis
[1m[31m | [0m [36m --> [0m[1marg[0m
[1m[31m | [0m [36m | [0m[37m[40mabc[0m[1m[7m[32m[40m([0m[37m[40m [0m
[1m[31m | [0m [36m | [0m[37m[40m [0m[1m[31m[40m^ [0m[1m[31m[40mmissing closing parenthesis[0m
[36m --> [0m[1m{test_dir}/bad-config/formats/invalid-sql/init2.sql[0m
[36m | [0m[1m[36m[40mSELECT[0m[37m[40m [0m[1m[37m[40mregexp_match[0m[1m[7m[31m[40m([0m[35m[40m'abc('[0m[37m[40m, [0m[35m[40m'123'[0m[37m[40m) [0m
[36m | [0m[1m[36m[40mFROM[0m[37m[40m [0m[37m[40msqlite_master[0m[37m[40m; [0m
|