Johann Burkard

Code snippets, quotes, BASH scripts and nonsense. Not surprisingly, my main site is called Johann Burkard, too. Check out my web applications: Online Audio Converter, QR Code Generator, Pearson and Spearman Correlation calculator, PDF to JPEG Converter, Forex Data Feed and my exchange rates calculator based on currencyfeed.com. Also, check out Ole’s Tauschbörse Arbeit.

Page 1 · Page 2 · Page 3 · Page 4 · Page 5 · Page 6 · Page 7 · Page 8 · Page 9 · Page 10

Oct 06 2010

Which files used the most bytes

The following snippet uses AWK to extract the files that produced the most traffic. It also prints how many times a particular file was requested.

awk '{uri=$2.$6;sizes[uri]+=$9;reqs[uri]++}END{for(i in sizes){print(sizes[i], i, reqs[i])}}' access.log | sort -r -n | head -n 50

Depending on your virtual host setup, you might have to change uri=$2.$6.

Page 1 · Page 2 · Page 3 · Page 4 · Page 5 · Page 6 · Page 7 · Page 8 · Page 9 · Page 10

Johann Burkard, , @johannburkard
Teisendorf, Germany
N 47° 51' 5.904", E 12° 49' 0.012"