cbl
Analytics for HTTP logs in Combined Log Format
Install
On a Linux or BSD machine, in a terminal, run:
mkdir -p ~/src
cd ~/src
wget -qO - https://adi.onl/cbl/cbl@1.0.0.tgz | tar -xzvf -
cd cbl
make install PREFIX=$HOME
Uninstall
cd ~/src/cbl
make uninstall PREFIX=$HOME
Usage
The package provides 8 scripts cblp, cblu, cblv, cblr and
cblvp, cblvu , cblvv and cblvr.
The cbl prefix stands for Combined Log and the suffixes stand for pages, unique, views and referrers.
The middle v in the second set stands for virtual host. The second set of 4 scripts is for the Combined Log with virtual hosts format. It's identical to the normal Combined Log except the name of the virtual host is prepended to each line.
Use the appropriate script for the statistic and for the log format:
Pages
$ cblp /var/www/access.log
/docs.html 641
/ 3227
Use sort -nrk 2 to sort on second column:
$ clp /var/www/access.log | sort -nrk 2
/ 3227
/docs.html 641
Uniques and Visits
Uniques and visits scripts output the actual unique and visit requests
by default. Use wc -l to count:
$ cblu /var/www/access.log | wc -l
2000
Referrers
$ cblr /var/www/access.log
none 865
https://example.com 1222
Use sort -nrk 2 to sort on second column:
$ cblr /var/www/access.log | sort -nrk 2
https://example.com 1222
none 865
We recommend using cblfb for filtering bots.
$ cblr /var/www/access.log | cblfb
none 821
https://example.com 1212
Also, it's a good idea to enable log rotation.
The scripts operate on GET requests to paths with no extension or
ending in .html that returned a 200 HTTP response status code.
https://example.com/docs
https://example.com/docs/
https://examples.com/docs.html
Files
- LICENSE
- Makefile
- NEWS
- README
- cblp
- cblp.1
- cblr
- cblr.1
- cblu
- cblu.1
- cblv
- cblv.1
- cblvp
- cblvp.1
- cblvr
- cblvr.1
- cblvu
- cblvu.1
- cblvv
- cblvv.1
Download
Changelog
1.0.0 - 2022-03-04
Added
- Add
NEWSfile - Add
distrule toMakefile - Add missing
cblvu.1manfile to dist package
Changed
- Hardcode all log fields in scripts
- Write simple description in README rather than
mancontents - Update
manpages to reflect new path patterns
Removed
- Delete
sharedirectory and references - Remove dependency on
cl
0.1.0
Added
- Combined Log analytics scripts