Knowledgebase
emscom > emscom Help Desk > Knowledgebase

Search help:


awk count client ip occurrence in log files

Solution

Problem:  report the number of errors produced by individual clients

This may be useful for tracking down attacks.

cat error_log | awk '{print $11}' | awk -F: '{print $1}' | sort | uniq -c

 

Problem:  report the number of hits by the top 10 clients

This may be useful for tracking down attacks.

#get top 10 client IPs of top 10 hit count from common format access log
cat  access_log | awk '{print $1}' | awk -F: '{print $1}' | sort | uniq -c | sort -bnr | head -10

 

 
Was this article helpful? yes / no
Related articles Bind 9 logging template
Linux change permissions conditionally
HP Envy 5540 will not print in colour
Article details
Article ID: 106
Category: Linux
Date added: 04-07-2017 07:26:04
Views: 403
Rating (Votes): Article not rated yet (0)

 
« Go back

 
Powered by Help Desk Software HESK, in partnership with SysAid Technologies