VisiData to read JSON, HTML and YugabyteDB

sudo yum install -y python3-pip python3-devel postgresql-devel gcc
pip3 install visidata psycopg2 lxml requests

Files

JSON — read config

DB — read SQL data

PGOPTIONS="-c random_page_cost=1e42" vd postgres://franck:Yugabyte@yb1.pachot.net:5433/yb_demo_northwind

HTML — Query server info

vd +:table_0:0:0 http://yb1.pachot.net:7000/tablet-servers

JSON — Query tserver metrics

vd -f json http://yb1.pachot.net:13000/statements
vd -f json http://yb1.pachot.net:9000/metrics

TEXT- read and search the logs

vd http://yb1.pachot.net:9000/logs?raw
;([IWEF])([0-9]+) ([0-9]{2}[:][0-9]{2}[:][0-9]{2}[.][0-9]{6}) ([0-9]+) ([^:]+)(:[0-9]+)

Bonus: Statements logs

awk 'BEGIN{print "Line\tTimestamp\tpid\tstatement"}/LOG:  statement: /{print gensub(/^([0-9-]+ [0-9:]+).[0-9]* [^ ]+ \[([^ ]+)\] LOG:  statement: /,NR"\t\\1\t
\\2\t",1)}' $(awk '$1=="stderr"{print $2}' $(find . -name current_logfiles)) | vd -f tsv

Developer Advocate at Yugabyte, Open Source distributed SQL database 🚀 Also Oracle ACE Director, Oracle Certified Master, AWS Data Hero, OakTable member

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

HTML Best Practices: HTML5 Structural Elements

The Problem with JsonSerializable and Doctrine when using Symfony

Software Testing Life Cycle: Step by Step Guide — QAwerk software testing outsourcing company

Circle Image (CircleAvatar)in Flutter

Provision a free personal Helm chart repo using GitHub

MacGruber says Wrong

6 reasons why I love what I do

Creating and Styling Accessible Tooltips

images/accessible_tooltips/definition.png

Giving `dep` a try: Using the new Go dependency tool with piladb

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Franck Pachot

Franck Pachot

Developer Advocate at Yugabyte, Open Source distributed SQL database 🚀 Also Oracle ACE Director, Oracle Certified Master, AWS Data Hero, OakTable member

More from Medium

NSQ with Docker in baby steps -70 lines of code

What is Docker ??

Log Analysis with PgBadger

Should we include inbuilt libraries in the requirements.txt file !?