-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
Ability to show show/hide/shorten/widen JSON columns with hotkeys #1146
Comments
First, I want to thank you for doing this writeup, that's a lot of work!
I think there's a technical limitation that prevents fields not in the You should've been able to put the fields in the
I think when I wrote the
I can experiment with this, there is already functionality to overlay column headers in the display.
You can add
Pressing I'll get to looking into these changes soon, thanks again! |
Is your feature request related to a problem? Please describe.
I was looking for a tool to comfortably view our NGINX JSON access logs (sample log and my improvised format file attached) and discovered
lnav
. It fits my requirements reasonably well, but there are some things that I think could be better:These JSON logs contain a lot of fields; many of these usually aren't important when examining the logs, so I've marked them as
hidden
in my format. Unfortunately this means that if these fields are necessary during an investigation, I would need to edit the format file to make them visible.The access_log format would lend itself very well to strictly aligned columns, e.g. instead of this:
I would prefer this:
This is kinda doable with
min-width
andmax-width
:But this has several disadvantages:
lnav
to show the overflow, not even in the lo-fi view.I would like to see the column headers so that I know which column is which. This becomes especially necessary for the numeric columns -
200 73 169 0.176
means in that order: HTTP response code, bytes received from client, bytes sent to client, duration of the request. Currently, you need to know this by heart to make sense of the numbers.I tried to work around this by postfixing some numbers with identifiers:
I had hoped to display the numbers as e.g. "200 73r 169s 0.176", but instead the numbers are aligned to their width first, and only then are the characters affixed (
73 r 169 s
). There is apparently no way to mangle a field before it is aligned.A detail view that can show all fields, even those that are hidden, and without any shortening applied to the overview, might be useful.
Describe the solution you'd like
The ability to show and hide arbitrary columns during runtime with hotkeys. E.g. if I need the
remote_port
column which is hidden by default in my format, I would like to be able to open a list of columns that are defined by the format, and the ability to choose which are displayed. Similar to howhtop
does it (F2 -> Columns).The ability to define aligned columns in the format that are automatically aligned to an automatically determined max-width, optionally with a hardcoded max-width. E.g. if the
iserv_user
column is empty in all lines, the column shouldn't take up any space at all; if the biggestiserv_user
value in a line 32 characters, the column should align to 32 characters; if amax-width
of 20 is specified in the format, it should align to 20 characters.The ability to disable field shortening with a hotkey. E.g. if I usually shorten IP addresses to 14 characters but now I need to be able to see a specific IPv6 address in full, I want to be able to press a hotkey to disable the shortening. It might even be useful to be able to configure this per-column, so that I could disable the shortening for IP addresses, but not for user agents.
I would like a header bar that shows the names of all columns, that is always visible, so that I know which column contains what information.
A detail view where I could select a certain row and press a hotkey, that shows all fields that are available for this row, even ones that are usually hidden, might be useful.
Describe alternatives you've considered
min-width
andmax-width
is a passable workaround to get aligned columns.r
ands
for received and sent kinda works around the missing column headers.lnav
to use a certain format. Ability to force log format? #454?nginx_access_log_json.json.txt
access.log.json.txt
The text was updated successfully, but these errors were encountered: