dd-logstats
is a simple program for parsing W3C Common Log lines and displaying statistics and alarms about the traffic.
dd-logstats
does the following:
- reads log lines from
stdin
- aggregates statistics according to the section of the URL
- raises alarms on the frontend when traffic is too high
In order to build dd-logstats
you need:
- a working Go (>= 1.6) installation
make
- Glide (>= 0.12)
$ git clone https://github.com/j-vizcaino/dd-logstats $GOPATH/src/dd-logstats
$ cd $GOPATH/src/dd-logstats
$ make
The easiest way to feed dd-logstats
is by using the tail
program:
- start the program
$ tail -F /var/log/nginx/access.log | ./dd-logstats
- open a browser to visit http://localhost:8080/
Full argument options can be printed starting the program with -help
.
Most important options:
-serve
: specifies the server listen address. Example::12345
-alarm-threshold
: sets the alarm threshold (average hit for the given time frame)-alarm-timeframe
: time frame for the average hit alarm. Example:2m0s
-stats-period
: statistics aggregation period. Example:10s