Last active
June 29, 2022 11:12
-
-
Save DominicWatts/45ea7e864766038ef1d43aee84e36886 to your computer and use it in GitHub Desktop.
Most visited IPs Access log nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## cat | |
# various | |
cat access.log | awk '{print $1}' | sort | uniq -c | sort -g | tail -n 20 | |
cat access.log | grep 'wp-admin.php' | awk '{print $1}' | sort | uniq -c | sort -g | tail -n 20 | |
cat access.log | grep "85.93.20.26" | |
## tail | |
# user agent | |
tail access.log -n 10000 | awk '{print $12 $13 $14}' | sort | uniq -c | sort -g | tail -n 20 | |
# ip agent | |
tail domain-access.log -n 10000 | awk '{print $1 $12}' | sort | uniq -c | sort -g | tail -n 20 | |
# ip | |
tail access.log -n 10000 | awk '{print $1}' | sort | uniq -c | sort -g | tail -n 20 | |
# search for ip | |
tail access.log -n 10000 | grep "85.93.20.26" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment