Skip to content

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

Notifications You must be signed in to change notification settings

andersrex/pipe-gauge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages