VisiData - my new spreadsheet editor
The "What"
VisiData is a a terminal-based spreadsheet editor. Think of it like Excel in the terminal, but faster, and more powerful.
It can open CSV and XLSX files, view, filter, aggregate and display graphs.
It can also open JSON, JSONL, structured logs, YAML, pandas and much more.
The "Why"
If you've ever tried to open a large (I'm talking millions of rows) CSV file in LibreOffice Calc or Excel, then you know it takes ages, uses up a ton of ram and slows your computer down.
On the other hand, VisiData quickly opens files and allows you to start working on them instantly.
I've also found it extremely useful for reading jsonl log files the programs I work with produce. I can quickly filter logs to get to the ones I need to debug an issue, or check if a processes has completed and with what success rate.
The "How"
In this section, I'm going to quickly go over how I process some logs from kubernetes.
- grab the logs and pipe them into VisiData
kubectl logs $(firstpod) | grep '^{'` | vd
. Thegrep
portion simply filters out any lines that are not JSONL (because they don't start with the{
character. - Since my logs come from a python application, each log has a
logger
datapoint. I move to that column and apply a regex filter -> select by typing|application-name
- I create a new sheet with just the selected rows by pressing
"
- Optionally, I can focus on a specific log line with the
enter
key and go back with theq
key.
The VisiData documentation is well written and can get you started quickly. Once you are up and running, you can use this cheatsheet I found to help remember key-binds.