lnav
lnav copied to clipboard
dmesg format
lnav version v0.8.5
I try to make a format for the dmesg command :
$ dmesg -x
kern :notice: [ 0.000000] Linux version 5.4.0-77-generic (buildd@lgw01-amd64-028)
...
I'm running into the following bug displaying the date :
dmesg -x | lnav
kern :notice: [ 6284-09-07 22:16:56.000000] Linux version 5.4.0-77-generic (buildd@lgw01-amd64-028)
My format:
"pattern" : "^(?<module>[^:\\s]*)\\s*:(?<level>[^:\\s]*)\\s*: \\[\\s*(?<timestamp>\\d+\\.\\d{6})\\] (?<body>.*)$"
"timestamp-format" : [ "%s.%f" ],
"sample" : [
{
"line" : "kern :warn : [ 12.233441] VBoxNetAdp: Successfully started."
}
Hmm, on the latest version, the timestamp is not accepted because it is zero:
error:dmesg_log:invalid sample -- kern :notice: [ 0.000000] Linux version 5.4.0-77-generic (buildd@lgw01-amd64-028)
error:dmesg_log:unrecognized timestamp format -- 0.000000] Linux version 5.4.0-77-generic (buildd@lgw01-amd64-028)
format: %s.%f; matched: 0
I'm not quite sure I remember why zero is not allowed... I'll revisit this, thanks for raising it.
related to https://github.com/tstack/lnav/issues/481