[nflug] grep, sort, uniq - How To Count?

Carver, Blake Blake.Carver at nypa.gov
Wed Dec 13 09:21:30 EST 2006


I'm trying to grep some evil link spammer IPs out of an Apache log, and
I'd like to reduce the number of false positives by limiting the IPs to
just a certain number of hits to a file, say 10 hits to a Wordpress
comment file, so I can do this and see hits to that file, and order them
by hits
 
grep wp-comments-post /var/log/httpd/access_log | cut "-d " -f2  | sort
| uniq -c | sort -nr | 
 
But after that last pipe what I'd like to do is pull out just IPs with
hits greater than 10. I can do "head -20" but that'll only give me the
top 20 and that can be any number of hits.
 
Any ideas? Maybe I need to approach it a different way altogether?
 
Thanks
Blake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nflug.org/pipermail/nflug/attachments/20070525/be125d04/attachment.html
-------------- next part --------------
_______________________________________________
nflug mailing list
nflug at nflug.org
http://www.nflug.org/mailman/listinfo/nflug


More information about the nflug mailing list