lnav icon indicating copy to clipboard operation
lnav copied to clipboard

Cannot use `filter-expr` with field name containing `/`

Open lbergnehr opened this issue 8 months ago • 1 comments

lnav version v0.11.2

Describe the bug In a json parser, if you have a known field named e.g. line/hostname it's not possible to filter on that column using filter-expr. It will say it's invalid format if you use :"line/hostname" = 'foo' or :line/hostname = 'foo'.

To Reproduce Use a parser that has nested json fields (also added as values in the parser definition) and parse a json log with it.

lbergnehr avatar Oct 25 '23 12:10 lbergnehr

Indeed, I'm not sure the best way to go about this, unfortunately. However, I think you can do what you want by reading the value out of the raw JSON variable (:log_raw_text), like so:

:filter-expr jget(:log_raw_text, '/line/hostname') = 'foo'

tstack avatar Oct 27 '23 18:10 tstack