Unix – Count Requests Per Seconds From Access Log File

egrep "^14:59" access.log|grep exectime| sed 's/.*14:59.\(..\).*/\1/g'|sort |uniq -c|sort -n
egrep "^14:" access.log|grep exectime| sed 's/.*14:\(.....\).*/\1/g'|sort |uniq -c|sort -n
grep exectime access.log | awk '{print $1,$16,$7}' > se1.log
tail -f /var/logs/access.log|grep exectime | awk '{print $1,$16,$7}'
grep "job processed" res.log | awk '{ print $1" "$2}'|sort -n|uniq -c|less

Result:

      6 2013-01-31 18:39:44
      4 2013-01-31 18:39:45
     34 2013-01-31 18:39:46
    150 2013-01-31 18:39:47
     11 2013-01-31 18:39:48
     20 2013-01-31 18:39:49
      1 2013-01-31 18:39:50
     17 2013-01-31 18:39:51
      4 2013-01-31 18:39:52

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *