如何使用远程服务器上的 lnav 程序?

2022-07-15 15:22:02 +08:00
 css3

有这么个需求,k8s 集群使用集群外的且网络互通的服务器上lnav, 下面这个指令不知道哪不行,提示: error: stdout is not a tty.

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
  ð« lnav@googlegroups.com
Version: lnav 0.10.1-dirty
522 次点击
所在节点    程序员
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/866440

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX