Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.3 KB

README.md

File metadata and controls

53 lines (37 loc) · 1.3 KB

pipe-gauge

Quickly turn logs into time-series histograms in your terminal.

Installation

cat https://github.com/andersrex/pipe-gauge/raw/master/gauge.py > gauge
chmod 744 gauge

Usage

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

How does pipe-gauge figure out timestamps when graphing non-real time logs?

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:002020-04-19 16:21:41