Skip to content

Instantly share code, notes, and snippets.

@jahil
Created December 20, 2015 14:43
Show Gist options
  • Save jahil/66e50000d975f9928b51 to your computer and use it in GitHub Desktop.
Save jahil/66e50000d975f9928b51 to your computer and use it in GitHub Desktop.
X-Forwarded-For IP Address Extract Uniq Apache Logs
tail -f access_log | awk '{ $1="";print}' | grep -o '\([0-9]\{2,3\}.\)\{3\}\.[0-9]\{2,3\}'
cat access_log | awk '{ $1="";print}' | grep -o '\([0-9]\{2,3\}.\)\{3\}\.[0-9]\{2,3\}' | sort -n | uniq -c | sort -nr | head -20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment