lnav icon indicating copy to clipboard operation
lnav copied to clipboard

Using lnav on remote server not working

Open seryte opened this issue 1 year ago • 2 comments

lnav version Version: lnav 0.10.1-dirty

Describe the bug

[root@remote1 ~]# kubectl logs -f pod1  | ssh -t root@remote "lnav"                                                                                                        
Authorized uses only. All activity may be monitored and reported.
error: stdout is not a tty.
usage: lnav [options] [logfile1 logfile2 ...]

A curses-based log file viewer that indexes log messages by type
and time to make it easier to navigate through files quickly.

Key bindings:
  ?     View/leave the online help text.
  q     Quit the program.

Options:
  -h         Print this message, then exit.
  -H         Display the internal help text.
  -I path    An additional configuration directory.
  -i         Install the given format files and exit.  Pass 'extra'
             to install the default set of third-party formats.
  -u         Update formats installed from git repositories.
  -C         Check configuration and then exit.
  -d path    Write debug messages to the given file.
  -V         Print version information.

  -a         Load all of the most recent log file types.
  -r         Recursively load files from the given directory hierarchies.
  -R         Load older rotated log files as well.
  -t         Prepend timestamps to the lines of data being read in
             on the standard input.
  -w file    Write the contents of the standard input to this file.

  -c cmd     Execute a command after the files have been loaded.
  -f path    Execute the commands in the given file.
  -n         Run without the curses UI. (headless mode)
  -N         Do not open the default syslog file if no files are given.
  -q         Do not print the log messages after executing all
             of the commands.

Optional arguments:
  logfileN          The log files, directories, or remote paths to view.
                    If a directory is given, all of the files in the
                    directory will be loaded.
Examples:
  To load and follow the syslog file:
    $ lnav

  To load all of the files in /var/log:
    $ lnav /var/log

  To watch the output of make with timestamps prepended:
    $ make 2>&1 | lnav -t

Paths:
  Configuration, session, and format files are stored in:
    ð /root/.lnav

  Local copies of remote files and files extracted from
  archives are stored in:
    ð /tmp/lnav-user-0-work

Documentation: https://docs.lnav.org
Contact:
  ð¬ https://github.com/tstack/lnav/discussions
  ð« [email protected]
Version: lnav 0.10.1-dirty

To Reproduce Steps to reproduce the behavior:

seryte avatar Jul 25 '22 02:07 seryte

I think you need to pass -tt to force the pty allocation. But, really, this isn't a supported use case at the moment. Can you do it the other way around? ssh into the host to run the command and pipe it into an land running locally?

tstack avatar Aug 03 '22 04:08 tstack

I think you need to pass -tt to force the pty allocation. But, really, this isn't a supported use case at the moment. Can you do it the other way around? ssh into the host to run the command and pipe it into an land running locally?

The -tt option also doesn't work, and the other way round definitely doesn't work, I'm operating in a k8s cluster

seryte avatar Aug 03 '22 04:08 seryte