Guest User

Untitled

a guest
Jan 23rd, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. tail -n 1000 /content/logs/httpd/*_access.log | awk -v d1="$(date --date='-5 min' '+%_d/%b/%Y:%H:%M:%S')" -v d2="$(date '+%_d/%b/%Y:%H:%M:%S')" '{Ti=substr($5,2)};( Ti > d1 && Ti <= d2 ) && $10 ~ /5[0-9][0-9]/ {Cnt++;print $10} END{print Cnt+0}'
  2.  
  3. awk -v d1="$(date --date='-5 min' '+%_d/%b/%Y:%H:%M:%S')" -v d2="$(date '+%_d/%b/%Y:%H:%M:%S')" '($5 < "[" d1){next};{Ti=substr($5,2)};( Ti > d1 && Ti <= d2 ) && $10 ~ /5[0-9][0-9]/ {Cnt++;print $10} END{print Cnt+0}' /content/logs/httpd/*_access.log
Add Comment
Please, Sign In to add comment