Replies: 1 comment 6 replies
-
It looks like your log file is in JSON-lines form, which is directly supported by lnav. You shouldn't have to use a regex to parse it out. The log format reference covers the details of how to write a log format file for a JSON-lines log. Unfortunately, the docs don't have an actual example, but there are some tests you can look at. For this log file: Lines 1 to 13 in 8d17561 The log format file looks like this: lnav/test/formats/jsontest/format.json Lines 1 to 36 in 8d17561 The rendered output then looks like this: (Note that the extra spacing is due to the leading Let me know if you need additional help in creating your format file. |
Beta Was this translation helpful? Give feedback.
-
I am using the following regex:
to capture messages in the following format:
That works fine, except some fields that show up that are not in the regex, like for example the
@errorObjectName
field above, it gets captured together as<message>
rather than being ignored.So I tried the following regex to achieve that desired behaviour which uses OR to capture the different fields that I want to parse out.
The problem is with the above when I run
lnav
I get the following error:So lnav won't allow me to load this formatter unless it fully matches everything......
Is there a way to achieve the behavior that I want? Or is it impossible with
lnav
?Beta Was this translation helpful? Give feedback.
All reactions