311 karma · joined Aug 30, 2013 (13y ago) · 137 submissions
comment 5y ago · link · parent
Ideally, it would be nice to integrate Angle Grinder into the lnav to support both modes. I also think the the angle-grinder/sumologic can be a bit friendlier than SQL in some cases.
comment 5y ago · link · parent
https://docs.lnav.org/en/latest/usage.html#viewing-files
So, you would just run it like so:
$ lnav 'mylog.*'comment 5y ago · link · parent
The documentation for the format files is here:
https://docs.lnav.org/en/latest/formats.html
The "timestamp-format" property in the format definition is an array of the formats to be tried beyond the builtin set.
Here are some example formats written by a user:
https://github.com/aspiers/lnav-formats
I think some of them define their own timestamp format.
comment 5y ago · link · parent
https://docs.lnav.org/en/latest/commands.html#adjust-log-tim...
That can be useful for doing minor alignments if clocks are slightly out of sync or doing timezone adjustments.
You can also adjust the time programmatically by updating the "time_offset" column in the "lnav_file" table:
https://docs.lnav.org/en/latest/sqltab.html#lnav-file
Sorry I don't have any examples written up to illustrate this at the moment...
comment 5y ago · link · parent
https://lnav.org/2021/05/03/tailing-remote-files.html
So, to tail "/path/to/log" on host1 and host2, you'd start lnav with:
$ lnav host1:/path/to/log host2:/path/to/log
[1] - This is the initial release of this feature, so it probably has some performance issues. I'd be interested to know if it worked or not.comment 5y ago · link · parent
comment 5y ago · link · parent
I’ll be using this feature in my day-to-day work because I interact with short-lived VMs running the software I’m developing. Being able to run lnav on my devbox and have it live-tailing logs on the VMs running the changes will be an improvement over the current workflow where I manually copy the files onto the devbox.
comment 5y ago · link · parent
comment 5y ago · link · parent
comment 5y ago · link · parent
[0] - https://lnav.org
comment 5y ago · link · parent
There are at least two tools that support directly querying log files with SQL:
* logparser -- https://en.wikipedia.org/wiki/Logparser
* lnav -- https://lnav.org
lnav uses SQLite and provides quite a few extensions, so quite a lot is possible. The logs are exposed via virtual tables, so there is no separate import step.
comment 5y ago · link · parent
You really can't imagine that someone feels differently? Please try to have a more open mind.
I, for one, would much rather spend my free time on my side-project that is actually used by people. I would have a hard time working on something that was a throwaway. (Which is what actually happened when I tried to interview at FB. I spent more time working on the side-project than studying leetcode. FB promptly told me I couldn't code... "OK")
comment 5y ago · link · parent
comment 5y ago · link · parent
[0] - https://github.com/tstack/lnav/blob/master/test/scripty.cc
comment 6y ago · link · parent
comment 6y ago · link · parent
It sounds like you are not familiar with this disaster:
https://en.wikipedia.org/wiki/Hyatt_Regency_walkway_collapse
There may be a very good reason things are the way they are.
comment 6y ago · link · parent
* lnav about 4 seconds to index[1] and display
* vim about a second to display
* emacs about 3 seconds to display
This is on a late 2013 27-inch iMac with a 3.5Ghz i7 and the file cached.
[1] - Indexing in lnav involves parsing all log lines to extract their timestamp and log level (status codes in this case)
comment 6y ago · link · parent
comment 6y ago · link · parent
Same here and I'm confused as to why this comment has been downvoted. It's a perfectly good question for level setting. You get an idea of how much the person knows about various aspects of the system without having to ask pointed questions that they may not know. Instead, they get to show you what they are knowledgeable about.
comment 8y ago · link · parent
comment 10y ago · link · parent
[1] - https://github.com/tstack/lnav/blob/master/src/ptimec.cc
comment 10y ago · link · parent
comment 11y ago · link · parent
You complain about having to put initialization into 2 constructors, but there's the flip-side with things like mutexes. In c++, you have to have 2 classes, one for the lock and one for the guard. Whereas with a context-manager, you have one class and the locking code is in the __enter__ and __exit__.
with self.lock:
self.do_stuff()
In that case, I would say that the context-manager is nicer.comment 11y ago · link · parent
make |& lnav
The '-t' option will prepend timestamps to the lines that are coming in on stdin so that it will be treated as a log file. The '-w <file>' option will write the stdin data to a file if you want to look at it later: make |& lnav -t -w /tmp/make.out
Is that what you're asking about?comment 11y ago · link · parent