Follow

Count and sort unique ip addresses of visitors from nginx access logs:

$ for ip in $(cat /var/log/nginx/access.log | cut -d' ' -f1 | uniq); do whois $ip | grep "^country:" | head -n1 | awk '{print $2}'; done | sort | uniq -c | sort -nr

Sign in to participate in the conversation
Mastodon

Bienvenue sur l'instance personnelle de Couka.