Skip to content

Instantly share code, notes, and snippets.

@kimitoboku
Created June 23, 2015 15:36
Show Gist options
  • Save kimitoboku/9caaf5ec8334ee884bf4 to your computer and use it in GitHub Desktop.
Save kimitoboku/9caaf5ec8334ee884bf4 to your computer and use it in GitHub Desktop.
while true
do
D=`data -d '5 seconds ago' +"%d/%b/%Y:%k:%M:%S"`
sleep 1
cat /etc/httpd/logs/access_log | grep "$D" | cut -d " " -f 1 | sort | uniq -c |sort -nr | awk '$1 > 2{print $2}'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment