awk , 统计secure.log中 每个破解你密码的ip的出现次数|access.log 中 每个ip地址出现的次数

统计secure.log中 每个破解你密码的ip的出现次数

[root@oldboyedu-sh01-lnb files]# awk '/Failed password/{h[$(NF-3)]++}END{for(pol in h) print pol,h[pol]}' secure-20161219  |sort -rnk2|head

统计access.log 中 每个ip地址出现的次数

[root@oldboyedu-sh01-lnb files]# awk   '{h[$1]++}END{for(pol in h) print pol,h[pol]}' access.log |sort -rnk2 |head

 

posted @ 2018-04-24 20:28  王进  阅读(733)  评论(0)    收藏  举报