V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
css3
V2EX  ›  程序员

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

  •  
  •   css3 · 2022-07-15 15:22:02 +08:00 · 493 次点击
    这是一个创建于 663 天前的主题,其中的信息可能已经有所发展或是发生改变。

    有这么个需求,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
      ð« [email protected]
    Version: lnav 0.10.1-dirty
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5671 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 03:42 · PVG 11:42 · LAX 20:42 · JFK 23:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.