You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**/**_regexp_| Start a search for the given regular expression. The search is live, so when there is a pause in typing, the currently running search will be canceled and a new one started. The first ten lines that match the search will be displayed in the preview window at the bottom of the view. History is maintained for your searches so you can rerun them easily. Words that are currently displayed are also available for tab-completion, so you can easily search for values without needing to copy-and-paste the string. If there is an error encountered while trying to interpret the expression, the error will be displayed in red on the status line. While the search is active, the 'hits' field in the status line will be green, when finished it will turn back to black. |
273
-
|**:**<command>| Execute an internal command. The commands are listed below. History is also supported in this context as well as tab-completion for commands and some arguments. The result of the command replaces the command you typed. |
274
-
|**;**<sql>| Execute an SQL query. Most supported log file formats provide a sqlite virtual table backend that can be used in queries. See the SQL section below for more information. |
275
-
|**|**<script>[arg1...]| Execute an lnav script contained in a format directory (e.g. \~/.lnav/formats/default). The script can contain lines starting with `:`, `;`, or `\|` to execute commands, SQL queries or execute other files in lnav. Any values after the script name are treated as arguments can be referenced in the script using `\$1`, `\$2`, and so on, like in a shell script. |
276
-
| CTRL+], ESCAPE | Abort command-line entry started with `/`, `:`, `;`, or `\|`.|
273
+
|**:**<command>| Execute an internal command. The commands are listed below. History is also supported in this context as well as tab-completion for commands and some arguments. The result of the command replaces the command you typed. |
274
+
|**;**<sql>| Execute an SQL query. Most supported log file formats provide a sqlite virtual table backend that can be used in queries. See the SQL section below for more information. |
275
+
|**|**<script>[arg1...]| Execute an lnav script contained in a format directory (e.g. \~/.lnav/formats/default). The script can contain lines starting with `:`, `;`, or `|` to execute commands, SQL queries or execute other files in lnav. Any values after the script name are treated as arguments can be referenced in the script using `$1`, `$2`, and so on, like in a shell script. |
276
+
| CTRL+], ESCAPE | Abort command-line entry started with `/`, `:`, `;`, or `|`. |
277
277
278
278
> **Note**: The regular expression format used by lnav is
279
279
> [PCRE](http://perldoc.perl.org/perlre.html)
@@ -502,26 +502,26 @@ template.
502
502
## Other SQL Features
503
503
504
504
Environment variables can be used in SQL statements by prefixing the
505
-
variable name with a dollar-sign (\$). For example, to read the value of
505
+
variable name with a dollar-sign ($). For example, to read the value of
506
506
the `HOME` variable, you can do:
507
507
508
508
```lnav
509
-
;SELECT \$HOME;
509
+
;SELECT $HOME;
510
510
```
511
511
512
512
To select the syslog messages that have a hostname field that is equal
513
513
to the `HOSTNAME` variable:
514
514
515
515
```lnav
516
-
;SELECT * FROM syslog_log WHERE log_hostname = \$HOSTNAME;
516
+
;SELECT * FROM syslog_log WHERE log_hostname = $HOSTNAME;
517
517
```
518
518
519
519
NOTE: Variable substitution is done for fields in the query and is not
520
520
a plain text substitution. For example, the following statement
521
521
WILL NOT WORK:
522
522
523
523
```lnav
524
-
;SELECT * FROM \$TABLE_NAME; -- Syntax error
524
+
;SELECT * FROM $TABLE_NAME; -- Syntax error
525
525
```
526
526
527
527
Access to lnav's environment variables is also available via the "environ"
0 commit comments