Compter le nombre d'IP récurrente sur un serveur Apache.
From Tuxunix
- Compte le nombre d'IP ayant consulté le site :
#> cat /var/log/apache2/fichierApache-access.log | awk '{ print $1}' | sort | uniq -c | sort -k1 -n >/root/cpteNbrIp.txt
Exemple :
8927 119.42.98.67 13699 93.32.144.192 33570 94.249.68.31 34533 46.116.96.232
- Compte le nombre d'IP ayant consulté le site et affiche le referer :
#> cat access.log | awk '{ print $1 $11}' | sort | uniq -c | sort -k1 -n
Exemple :
10 123.125.71.29"-"
10 193.201.137.172"http://webcache.googleusercontent.com/search?q=cache:nDIvXbPEgkIJ:www.tuxedo.fr/+programmation+linux+c%2B%2B&cd=1&hl=fr&ct=clnk&gl=fr&source=www.google.fr"
12 193.47.80.44"-"
12 220.181.108.84"-"
13 192.54.193.26"http://www.tuxedo.fr/"
13 193.47.80.82"http://www.tuxedo.fr/tuxedo.css"
- Additionne le nombre d'IP récurrente
#> cat /var/log/apache2/fichierApache-access.log | grep "sibesoinPourUrlparticulier" | awk '{ print $1 }' | sort | uniq -c | sort -k1 -n | awk '{ SUM+= $1} END { print SUM}'
Exemple :
5140

