lltsv1
List specified keys of ltsv (labeled tab separated values)
Usage
lltsv [--key
value]
[-k
value]
[--no-key]
[-K]
[--ignore-key
value]
[-i
value]
[--filter
value]
[-f
value]
[--expr
value]
[-e
value]
[--help]
[-h]
[--version]
[-v]
Overview
lltsv is a command line tool to list specified keys of LTSV (Labeled Tab Separated Values) text with colorized output to a terminal. It supports to filter with some comparing operators (arithmetic expression or regular expression)
Options
-
--key value -
keys to output (multiple keys separated by ,)
-
--no-key, -K -
output without keys (and without color)
-
--ignore-key value, -i value -
ignored keys to output (multiple keys separated by ,)
-
--filter value, -f value -
filter expression to output
-
--expr value, -e value -
evaluate value by expression to output
-
--help, -h -
show help
-
--version, -v -
print the version
Examples
- Example1:
-
$ echo "foo:aaa\tbar:bbb" | lltsv
-kfoo,bar- foo:aaa bar:bbb
The output is colorized as default when you outputs to a terminal. The coloring is disabled if you pipe or redirect outputs.
- Example2:
-
$ echo "foo:aaa\tbar:bbb" | lltsv
-kfoo,bar-K- aaa bbb
Eliminate labels with "-K" option.
- Example3:
-
$ lltsv
-kfoo,bar-Kfile*.logSpecify input files as arguments.
- Example4:
-
$ lltsv
-kresptime,status,uri-f'resptime > 6' access_log$ lltsv -k resptime,status,uri -f 'resptime > 6' -f 'uri =~ ^/foo' access_log
Filter output with "-f" option. Available comparing operators are:
- •
-
>= > == < <= (arithmetic (float64))
- •
-
== ==* != !=* (string comparison (string))
- •
-
=~ !~ =~* !~* (regular expression (string))
The comparing operators terminated by * behave in case-insensitive. You can specify multiple
-foptions (AND condition).
- Example5
-
$ lltsv
-kresptime,upstream_resptime,diff-f'diff = resptime - upstream_resptime' access_log$ lltsv -k resptime,upstream_resptime,diff_ms -e 'diff_ms = (resptime - upstream_resptime) * 1000' access_log
Evaluate value with "-e" option. Available operators are: + - * / (arithmetic (float64))
Releases
Unchanged in 3 releases since Debian 11 (Bullseye).