Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Nice! I've been in rapid-response situations where I had to pull logs from various sources (including embedded devices) that weren't unified in a central logging service. I could get the logs onto my workstation, but then manually lining up who-saw-what-when involved a headache, even with Emacs. lnav seems to have a few features to support this.

One very useful feature for this I didn't see listed for lnav was to support adjusting for timestamps in different timezones, like maybe you have a desktop's log in local time that you're trying to reconcile with servers. (A related but less-important bonus would be to be able to specify smaller arbitrary clock drift/offsets for each log.)



> One very useful feature for this I didn't see listed for lnav was to support adjusting for timestamps in different timezones, like maybe you have a desktop's log in local time that you're trying to reconcile with servers. (A related but less-important bonus would be to be able to specify smaller arbitrary clock drift/offsets for each log.)

You can adjust the timestamps for a file using the ":adjust-log-time" command (https://docs.lnav.org/en/latest/commands.html#adjust-log-tim...). For example, if you wanted to shift the timestamps back an hour, you can do:

    :adjust-log-time -1h
The shift is applied to the messages in the file that the top line in the view belongs to.

If you want to do the shift programmatically, you can UPDATE the "time_offset" column of the "lnav_file" table directly (see https://docs.lnav.org/en/latest/sqltab.html#lnav-file)


Thanks!




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: