lnav icon indicating copy to clipboard operation
lnav copied to clipboard

Great to review recent loggings (eg lnav piper://p-bc2dd3af67ba6d7fb7610f6bd0428b86-000) can session save too?

Open cw1nte opened this issue 10 months ago • 2 comments

Having run a large log extract at some point in time, and pared down to what I need with filters, I often want to pick up on some details from that session later and lnav piper://p-bc2dd3af67ba6d7fb7610f6bd0428b86-000 is a great way, that I think auto deletes data after 24hours. AFAIK an explicit :save-session-to is needed to get the filters etc saved but matching filter names to the pipe in advance of exiting is impossible/messy/may not be thought of & hard to tidy up and administer.

Is there a way to append the session info to the pipe data so that they come back together, and expire together after the 24 hours? I think that would be so much more useful. If there are situations where it might be a bad idea perhaps there could be a pre-exit query about saving session info?

cw1nte avatar Mar 13 '25 14:03 cw1nte

Thanks for filing this issue, I agree that this should "just work".

I've pushed a change that fixes the :export-session-to command so that it includes an :open command with the piper:// URL for the content that was piped in. If you want to try it out, you can download a build from the latest "bins" workflow run:

https://github.com/tstack/lnav/actions/workflows/bins.yml

I still need to figure out if I can make it work by just passing in the piper URL on the command line. That's a little more involved.

tstack avatar Mar 13 '25 19:03 tstack

I was thinking to have the logic the other way (is that what you meant by passing the piper URL on command line?) so no explicit call to export-session is needed. The session state is there with the pipe data and is retrieved if/when the pipe is re-used. The inclusion of default of piper URL for the export-session links them but still requires me to know of & think of the export step - but I sometimes have not used it for many weeks... I hope there is some way to stash & retrieve the session info at the start of the pipe! Too busy catching up on ISP swapping complications to do much right now...

cw1nte avatar Mar 14 '25 17:03 cw1nte