is it possible from shell utility that we can track top 10 ipaddress from squid access.log who visit facebook.com.
cat /var1/log/squid/access.log | grep "192.168.1.13" | grep "facebook" | wc -l
777
above will find only one
is it possible from shell utility that we can track top 10 ipaddress from squid access.log who visit facebook.com.
cat /var1/log/squid/access.log | grep "192.168.1.13" | grep "facebook" | wc -l
777
above will find only one
You should rename yourself into learncodetags if you want to stay a member of this forum
Just the top 10 ie. first ten of the list of 777 IP addresses?
grep "192.168.1.13" /var1/log/squid/access.log| grep "facebook"| head
It will be better to paste some sample logs to us.
Guess you need find out top 10 IP addresses (not only 192.168.1.13) which access facebook, and the IP address is in first column in log file.
awk '/facebook/ {print $1}' /var1/log/squid/access.log |sort |uniq -c |sort -n |tail -10