LLTSV(1)

πŸ’– LLTSV(1) πŸ’–

okay bestie, sit down, hydrate, and let me tell you about lltsv from the User Commands section of the manual. this one's a little legend and you're gonna be obsessed. 🫢


✨ NAME ✨

lltsv β€” List specified keys of LTSV (Labeled Tab Separated Values)


🌸 SYNOPSIS 🌸

lltsv [global options] command [command options] [arguments...]
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]

πŸ’… DESCRIPTION πŸ’…

so lltsv is a command line tool that lists the keys you asked for out of LTSV (Labeled Tab Separated Values) text, and it gives you colorized output when you're on a terminal. iconic behavior, honestly.

it also supports filtering with a bunch of comparing operators β€” either arithmetic expressions or regular expressions. it's giving Swiss Army knife but make it cute. πŸ”₯


πŸ‘‘ OPTIONS πŸ‘‘

  • --key value β€” the keys you wanna output (if you want multiple, separate them with ,)
  • --no-key, -K β€” output without keys (and, fair warning, without color either)
  • --ignore-key value, -i value β€” keys to leave out of the output (multiple keys separated by ,)
  • --filter value, -f value β€” filter expression for what gets output
  • --expr value, -e value β€” evaluate a value by expression and output it
  • --help, -h β€” show help
  • --version, -v β€” print the version

🌈 EXAMPLES 🌈

Example1 ✨

$ echo "foo:aaa\tbar:bbb" | lltsv -k foo,bar
foo:aaa   bar:bbb

the output is colorized by default when you're outputting to a terminal. the coloring is disabled if you pipe or redirect the outputs β€” so don't be confused when the colors ghost you, that's just how it works. πŸ’€

Example2 ✨

$ echo "foo:aaa\tbar:bbb" | lltsv -k foo,bar -K
aaa       bbb

the -K option eliminates the labels. bye labels, you did nothing wrong but you gotta go. πŸ™ˆ

Example3 ✨

$ lltsv -k foo,bar -K file*.log

you can specify input files as arguments. yes, globs, she eats. πŸ“

Example4 ✨

$ lltsv -k resptime,status,uri -f 'resptime > 6' access_log
$ lltsv -k resptime,status,uri -f 'resptime > 6' -f 'uri =~
^/foo' access_log

filter the output with the -f option. the available comparing operators are:

  • >= > == < <= β€” arithmetic (float64)
  • == ==* != !=* β€” string comparison (string)
  • =~ !~ =~* !~* β€” regular expression (string)

the comparing operators that end in * behave case-insensitive. and yes, you can stack multiple -f options β€” that's an AND condition, so every filter has to agree. no cap. πŸ’œ

Example5 ✨

$ lltsv -k resptime,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 a value with the -e option. the available operators are: + - * / β€” arithmetic (float64). math class but it actually serves. 🧚


πŸŽ€ AUTHOR πŸŽ€

sonots <sonots@gmail.com> β€” the main character who made all of this happen. πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

https://github.com/sonots/lltsv


and that's the whole vibe check bestie! this page came from the lltsv manual, dated September 2020, and it's literally just LLTSV(1) β€” go forth and tab-separate your little heart out. slay, periodt. πŸ’–βœ¨πŸŽ€