User Tools

Site Tools


log_hits

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
log_hits [2016/05/20 07:01] luke7858log_hits [2024/05/23 07:26] (current) – external edit 127.0.0.1
Line 50: Line 50:
 7 113.190.128.197 "POST /xmlrpc.php 7 113.190.128.197 "POST /xmlrpc.php
 7 117.4.251.108 "POST /xmlrpc.php 7 117.4.251.108 "POST /xmlrpc.php
 +</sxh>
 +\\
 +=== Finding Crawlers ===
 +**Note:** You will need to change date range and make sure you run the very first LOG command on this page first. 
 +<sxh bash>
 +LC_ALL=C awk '/21\/Jul\/2016:20:4/ {REQ[FILENAME" "substr($0,index($0,$12))]++}END{for (i in REQ) print REQ[i],i}' $(echo "$LOGS" | grep access) | sort -rn | egrep -i "bot|crawl|spider|slurp" | head -25
 +</sxh>
 +\\
 +=== Accurate number of Apache requests per hour ===
 +**Note:** Change date range and log file locationg
 +<sxh bash>
 +LC_ALL=C awk '/02\/Aug\/2016/ && $0 !~ /(.js|.png|.jpg|.css|.ico) HTTP|.*Monitoring/' /var/log/nginx/exampledomain.com | cut -d[ -f2 | cut -d] -f1 | awk -F: '{print $2":00"}' | sort -n | uniq -c
 +</sxh>
 +\\
 +=== Log requests for Specific date/time range ===
 +**Note:** Change date/time and log file location
 +<sxh bash>
 +LC_ALL=C awk -F \" '/09\/Jun\/2016:(10:[12345]|11:[01])/ && $0 !~ /(.js|.png|.jpg|.css|.ico) HTTP/ {REQ[$2]++}END{for (i in REQ) print REQ[i],i}' /var/log/httpd/lexampledomain.com | sort -rn | head -50
 </sxh> </sxh>
log_hits.1463727703.txt.gz · Last modified: 2024/05/23 07:26 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki