Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dmesg format #878

Open
bonnefoi opened this issue Jun 29, 2021 · 2 comments
Open

dmesg format #878

bonnefoi opened this issue Jun 29, 2021 · 2 comments
Labels

Comments

@bonnefoi
Copy link

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."
            }
@bonnefoi bonnefoi added the bug label Jun 29, 2021
@tstack
Copy link
Owner

tstack commented Jun 30, 2021

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.

@Congee
Copy link

Congee commented Nov 28, 2022

related to #481

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants