Skip to content

Instantly share code, notes, and snippets.

@mcunha98
Created April 16, 2021 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcunha98/62d85080234f27f29fd60f0e4733d593 to your computer and use it in GitHub Desktop.
Save mcunha98/62d85080234f27f29fd60f0e4733d593 to your computer and use it in GitHub Desktop.
#Count the access_log , group by ip and hits, sort by desc and cut to 50 top results
CC='\033[1;33m'
NC='\033[0m'
printf "Lista dos top ${CC}50${NC} enderecos IP e visitas na data de hoje\n"
echo "Baseado no arquivo /var/log/httpd/access.log"
cat /var/log/httpd/access.log | awk '{print $1}' | sort -t":" -k2,2 | uniq -c | sort -fr | head -n50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment