Skip to content

Instantly share code, notes, and snippets.

@greenbicycle
Created February 11, 2016 20:18
Show Gist options
  • Save greenbicycle/394c001063daafb2c61d to your computer and use it in GitHub Desktop.
Save greenbicycle/394c001063daafb2c61d to your computer and use it in GitHub Desktop.
List top 10 ip addresses that are hitting wp-login in access log
#!/bin/bash
#
# List the top 10 IP addresses that are hitting wp-login.php, sorted by number of lines in access.log
#
# @tags: Wordpress, access, apache, ip addresses
grep wp-login access.log | awk '{print $1}' | sort | uniq -c | sort -nr | head -n 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment