Currently using the following line to get top 20 ips sorted by requests:
grep 'GET /' /var/log/nginx/access.log | awk '{ print $1 }' | sort -n | uniq -c | sort -rn | head -20
Output:
575 66.249.*.*
570 66.249.*.*
534 207.46.*.*
511 157.55.*.*
493 66.249.*.*
435 207.46.*.*
383 66.249.*.*
378 157.55.*.*
368 66.249.*.*
336 66.249.*.*
334 188.165.*.*
332 174.24.*.*
292 54.209.*.*
251 66.249.*.*
241 66.249.*.*
234 66.249.*.*
226 66.249.*.*
225 89.145.*.*
221 89.145.*.*
209 66.249.*.*
I would like to lookup each ip using "host"
Is it possible to accomplish this in one line?
Thanks