so i run the bash script in the apache log file. I can sort the IP addresses and show the most common ones, but it shows it at the bottom of the page. No, how can I show this from highest to lowest
this is my script
cat access_log.txt | awk '{print $1}'| uniq -c |sort -n -k 1| tail
in my txt file i have
10.23.234.0
250.40.56.78
8.45.98.250
10.23.234.0
250.40.56.78
8.45.98.250
10.23.234.0
250.40.56.78
10.23.234.0
250.40.56.78
10.23.234.0
10.23.234.0
conclusion
2 8.45.98.250
4 250.40.56.78
6 10.23.234.0
I need a conclusion
6 10.23.234.0
4 250.40.56.78
2 8.45.98.250
also want the best way to print the DNS name next to it, so an example
66.249.73.234 - - [12/Fegb/2013:12:00:09 +1100] "GET /java/tut/tut.sgml-065.html HTTP/1.1" 200 752 "-" "Mozilla/6.0 (compatible; Googlebot/2.1; +http://www.google.com.html)"
therefore it would be
66.249.73.234 - http:
thank
source
share