Created
February 27, 2016 09:58
-
-
Save tuxnker/f3a91b782eec9c78ff83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function max(arr, big) { | |
big = 0; | |
for (i in cat) { | |
if (cat[i] > big) { big=cat[i]; } | |
} | |
return big | |
} | |
NF > 0 { | |
cat[$1]++; | |
} | |
END { | |
maxm = max(cat); | |
for (i in cat) { | |
scaled = 60 * cat[i] / maxm; | |
printf "%-25.25s [%8d]:", i, cat[i] | |
for (i=0; i<scaled; i++) { | |
printf "#"; | |
} | |
printf "\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Count IP hits from webserver logs
usage
cat /var/log/access.log|awk -f /home/raldea/dos.awk | sort -nrk3|less