just a logo :)

search:


See as: raw | code

terms of service | imprint

gibney.org
is powered by m1d1





recent log statistics. files, ips...
(Entry Nr. 3252, by user 1 | edit)

count which files have been accessed recently:



tail -n 10000 /var/log/apache2/access.log | LANG=C grep -o '"GET[^"]*"' | sort | uniq -c | sort -n

Same, but without query string:

tail -n 10000 /var/log/apache2/access.log | LANG=C grep -Eo '"GET[^"?]*(?|")' | sort | uniq -c | sort -n # URL STATS WITHOUT QUERY STRING

LANG=C speeds it up over 40 times.

count who sent the most requests recently:



tail -n 10000 /var/log/apache2/access.log | LANG=C grep -o '^[^ ]*' | sort | uniq -c | sort -n

count which hosts are accessed most:



tail -n 10000 /var/log/apache2/access.log | awk -F\" '{print $(NF-1)}' | sort | uniq -c | sort -n

explanation of ^ :
using " as delimiter, output only the next-to-last field.
it will break if there are unmatched " in the line, or if there are none

count referrers:



tail -n 10000 /var/log/apache2/access.log | grep -ioP '(?<="http://)[^/]+' | sort | uniq -c | sort -n
Create a new entry at this position