log_hits
This is an old revision of the document!
1 |
LOGS=$( lsof - ln | awk '$4 ~ /[0-9]w/ && $5 ~ /REG/ {FILE[$NF]++}END{for (i in FILE) print i}' ) |
1 |
for log in $( echo "$LOGS" | grep access); do HIT_COUNT=$( grep $( date "+%d/%b/%Y" ) $log -c); if [[ "$HIT_COUNT" - ge 100 ]]; then echo -e "\n$log - $HIT_COUNT total hits today\n" ; grep $( date "+%d/%b/%Y" ) $log | awk -F \" '{USER[$(NF-1)]++}END{for (i in USER) print USER[i],i}' | sort -n | tail -10 ; fi ; done |
log_hits.1457606080.txt.gz · Last modified: 2024/05/23 07:26 (external edit)