Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1758812
  • 博文数量: 323
  • 博客积分: 5970
  • 博客等级: 大校
  • 技术积分: 2764
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-03 23:13
文章分类

全部博文(323)

文章存档

2018年(2)

2017年(11)

2016年(10)

2015年(27)

2014年(2)

2013年(30)

2012年(197)

2011年(44)

分类: LINUX

2015-09-16 17:18:18

日志格式:
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for "$request_time"';
配置:
server {
server_name test.com;
root html;
index index.html;
access_log logs/access.log main;

}


可以为做性能测试统计平均时间

awk '{sum+=$10;count+=1} END{print "SUM:"sum"\nAVG:"sum/count"\nCOUNT:"count}' access_log2012-08-24.16.log


awk '{a_array[$1]+=$10;b_array[$1]++}END{for(i in a_array) print i":"a_array[i]":"b_array[i]}' access_log2012-08-24.16.log

阅读(1742) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~