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
Is it possible to define a log format without timestamp? #728
Comments
Sorry, no, lnav requires a timestamp for logs at the moment. Can you give some sample logs to help me understand what you're trying to do? The timestamp is used to sort/collate log messages from different files into a single view. It's possible to view text files in lnav, but the functionality available for logs doesn't really carry over. |
Just gdb backtrace per thread, so I can easily filter the stack of interesting threads. ` Thread 523 (LWP 1004), GlobalIOThreadP: |
I'd like to use lnav for the debug logs generated by my algorithm prototype, where timestamps are totally meaningless and in principle should be strictly avoided. The log entries are sequential, so only the order of log entries is significant. Many features of lnav still apply to this use case, even though there is no correlation of logs from multiple sources. For now I will simply add a hidden timestamp, but it will bog down my prototype when a log gets larger than a few GB. As a simple implementation of a format with no timestamp, I would suggest that lnav assign an artificial integer timestamp to each entry. If the user tries to correlate multiple files, there will be a false interleaving line-by-line. This could be avoided with a (large) offset per file (i.e., file 2 starts at 1000000), or lnav could simply refulse to correlate files multiple files where the format has no timestamp. |
I have another log format that isn't usable with Google Cloud emulator logs (
Where most of the service log entries have a timestamp, for the Nodejs service's stdout writes appear with level, but no timestamps. The logs are ordered by timestamps, so some sort of pseudo-timestamp would be enough to obtain a reasonable ordering for my needs |
Hi, thanks for the lnav project, it is super usefull. |
I found this limitation while trying to define a log format for Ansible playbook output
I tried just shoving in an empty timestamp group. Unsurprisingly that didn't work ;)
Truncated example:
|
For Ansible, it looks like there's a You could also try the new Can I ask what you're looking to do with the Ansible output within lnav? |
I'm looking into use lnav to color and filter the dumped call stacks, however it appears that timestamp is required for a log pattern, is there a way to get around this?
error:quickstack_log:timestamp field 'timestamp' not found in pattern -- ^Thread (?\d+) (LWP \d+), (?<thread_name>.):\n(?#\d+ .\n)*
The text was updated successfully, but these errors were encountered: