Answer the question
In order to leave comments, you need to log in
How to display a table with accesses from logs to multiple sites by IP / Useragent?
Good day!
There are several dozen domains, I need to periodically check how many hits were made by certain user agents to the site content, in particular GoogleBot-Image / GoogleBot-News / YandexBot , as well as ResponseCode.
Now for a specific domain I do this:
cat domain.net.log | grep -i googlebot-image | awk '{print $9}' | sort | uniq -c | sort -nr
377 200
25 301
domain_mask | count | response_code
domain1 | 50000| 200
domain1 | 100 | 404
domain2 | 300 | 200
domainN | N | n
Answer the question
In order to leave comments, you need to log in
Read about ELK, maybe this is what you are looking for.
Video reviews with examples:
https://www.youtube.com/watch?v=Kqs7UcCJquM
https://www.youtube.com/watch?v=4X0WLg05ASw
https://www.youtube.com/watch?v=Hqn5p67uev4
Well something like this:
If there are several domains, then first perform a search by the domain mask, display unique entries in a text file, and wrap the above script line in a loop through the domain.
Then instead of <domain> there will be just a variable from the cycle
while read domain; do
find ./ -type f -name "${domain}*" -mtime <время последнего изменения файла (в днях)> -exec grep googlebot-image {} \; | awk '{print $9}' | sort | uniq -c | sort -nr | awk '{print "${domain}", $1, $2 }'
done <domains_list.txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question