Quickly turn logs into time-series histograms in your terminal.
cat https://github.com/andersrex/pipe-gauge/raw/master/gauge.py > gauge
chmod 744 gauge
Graph a file with historical timestamped logs
cat service.log | gauge
Graph a real time stream
tail -f service.log | gauge -f
Graph a real time stream with a custom time interval (10 sec)
tail -f service.log | gauge -f -i 10s
With rainbows
$ gem install lolcat
$ cat service.log | gauge | lolcat
gauge
uses dateutil.parser
to try to find a timestamp on each row of input data. If your input data contains multiple timestamps per row or numerical data that confuses dateutil.parser
, you can try using a tool like awk to narrow down you selection:
cat service.log | awk '{print $1,$2}' | gauge
2020-04-19 16:21:41 localhost: BackgroundAction scheduled: 2020-04-19 17:00:00
→ 2020-04-19 16:21:41