Debian Codegraph @

docs/options.md

raw
1 # Options
2
3 Options can be set or checked using `:set` command, for example:
4
5 - `:set numlines?` prints the current value of the `numlines` option
6 - `:set numlines=1000` sets `numlines` to the new value
7
8 So far there is no support for a persistent config file where we can specify initial values of these options, but you can provide them using the `--set` flag, like this:
9
10 ```
11 $ nerdlog --set 'numlines=1000' --set 'transport=ssh-bin'
12 ```
13
14 Currently supported options are:
15
16 ### `numlines`
17
18 The number of log messages loaded from every logstream on every request. Default: 250.
19
20 ### `timezone`
21
22 The timezone to format the timestamps on the UI. By default, `Local` is used, but you can specify `UTC` or `America/New_York` etc.
23
24 ### `transport`
25
26 Specifies what to use to connect to remote hosts (has no effect on `localhost`: this one always goes via local shell).
27
28 Valid values are:
29
30 - `ssh-lib`: Use internal Go ssh implementation (the [golang.org/x/crypto/ssh](https://pkg.go.dev/golang.org/x/crypto/ssh) library). This is what Nerdlog was using from the day 1, but it's pretty limited in terms of configuration; e.g. if you have more or less advanced ssh configuration, chances are that Nerdlog won't be able to fully parse it. Only some minimal parsing of `~/.ssh/config` is done.
31 - `ssh-bin`: Use external `ssh` binary. This is still a bit experimental, but a lot more comprehensive. The only observable limitation here is that if the ssh agent is not running, and ssh key is encrypted, then with `ssh-lib` Nerdlog would ask you for the key passphrase, while with `ssh-bin` the connection will just fail.
32
33 With `ssh-bin`, Nerdlog also uses the ssh config a bit differently: it only uses the list of hosts parsed from the ssh config to implement globs, so e.g. if your ssh config has two hosts `my-01` and `my-02`, then typing `my-*` in logstreams input would make Nerdlog connect to both of them. But, Nerdlog won't try to figure out the actual hostname, or usename, or port from the ssh config: it would simply run the command like `ssh -o 'BatchMode=yes' my-01 /bin/sh`, leaving all the config parsing up to that `ssh` binary.
34
35 However, the Nerdlog's own logstreams config is still interpreted as before; so if in that config you have e.g. this:
36
37 ```yaml
38 log_streams:
39 my-01:
40 hostname: myactualserver.com
41 port: 1234
42 user: myuser
43 ```
44
45 Then the ssh command will actually be: `ssh -p 1234 -o 'BatchMode=yes' [email protected] /bin/sh`
46
47 For now, `ssh-lib` is still the default, but the plan is to change that at some point and make `ssh-bin` the default if `ssh` binary is available.