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

Cannot use filter-expr with field name containing / #1201

Open
lbergnehr opened this issue Oct 25, 2023 · 1 comment
Open

Cannot use filter-expr with field name containing / #1201

lbergnehr opened this issue Oct 25, 2023 · 1 comment
Labels

Comments

@lbergnehr
Copy link

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 lbergnehr added the bug label Oct 25, 2023
@tstack
Copy link
Owner

tstack commented Oct 27, 2023

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'

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

2 participants