Skip to content

Instantly share code, notes, and snippets.

@hypnoJerk
Created June 5, 2016 19:36
Show Gist options
  • Save hypnoJerk/a3ccf0fea1713476245923287ee5e252 to your computer and use it in GitHub Desktop.
Save hypnoJerk/a3ccf0fea1713476245923287ee5e252 to your computer and use it in GitHub Desktop.
Parse apache2 access.log; display unique ip's on each line with a count of how many times it occurs. Sorts them
#!/bin/bash
#Parse apache2 access.log
#And count how many times an IP appears and sorts them
cat /var/log/apache2/access.log | awk '{print $1}' | sort | uniq -c | sort -n | tail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment