lnav icon indicating copy to clipboard operation
lnav copied to clipboard

Remote docker logs

Open Campano opened this issue 1 month ago • 3 comments

Is your feature request related to a problem? Please describe. I manage containers on many servers, wich often don't have lnav / the right version of lnav. The docker URL seems very handy, but I whish there was a way to use it remotely.

Describe the solution you'd like

lnav user@server:docker://container

Campano avatar Nov 27 '25 22:11 Campano

How do you envision this working? Would lnav ssh to the remote host and run docker logs?

tstack avatar Nov 28 '25 00:11 tstack

At the moment, I'm using this:

ssh user@server "docker exec -i containername tail -n +0 -F /path/to/log" | lnav

It works, but has two problems:

  1. in some cases, like scrolling up after the begining of the file, it stops and sends an exit message ⓘ info: 500KB of data from stdin was captured and will be saved for one day. You can reopen it by running: lnav piper://etc
  2. I need to remember the command / save it somewhere (from what i understood i could just create a custom URL...)

Campano avatar Dec 01 '25 11:12 Campano

ssh user@server ...

I think you need to pass -n to ssh so that it doesn't listen to stdin, which can mess things up (see #531).

tstack avatar Dec 01 '25 14:12 tstack