小试nginx日志分析xlog

时间:2023-05-31 21:35:08

nginx配置:

 http {
#...其他配置
log_format tpynormal '$remote_addr | [$time_local] | $host | "$request" | '
'$status | $body_bytes_sent | "$http_referer" | '
'"$http_user_agent" | "$http_x_forwarded_for" | '
'$upstream_addr | $upstream_status | $upstream_response_time | '
'$server_addr |$http_cookie|$request_time| ';
server {
#...其他配置
access_log /datas/log/www/access.abc_tp.log tpynormal;
}
}

脚本下载:http://pan.baidu.com/s/1bGAXEQ

使用及结果:

 [root@localhost ~]# cat /datas/log/www/access.abc_tp.log | ./xlog
No filter
Log count total: , filtered: , rate: 0.000000
Body bytes total: , filtered: , rate: 0.000000
Time seconds total: 17.71900, filtered: 0.00000, rate: 0.000000
Time average total: 0.07174, filtered: NaN
Time dist total: filtered:
<0.05 , 45.749%
0.05-0.1 , 41.700%
0.1-0.2 , 10.526%
0.5- , 1.215%
0.3-0.5 , 0.810%
Status code total: filtered:
, 100.000%
Http method total: filtered:
GET , 97.571%
POST , 2.429%
RealIP total: filtered:
127.0.0.1 , 98.381%
192.168.128.2 , 1.619%
Uri total:
16.194%, /?service=Stationmessage.StationNotice.getNewStationNoticeCenter&userId=&isCount=
8.097%, /?service=standard.options.getConfig&siteOptions=download_app
7.692%, /?service=user.users.getInfoById&userId=
4.453%, /?service=Live.anchor.followAnchorList&userId=&page=&limit=
4.453%, /?service=Live.Live.getNewHotList&userId=&page=&limit=&deviceNo=
4.453%, /?service=user.users.getUserInfoNumber&userId=
4.453%, /?service=Live.live.getNewFollowList&userId=&page=&limit=
4.049%, /?service=Live.Live.getNewFollowList&userId=&page=&limit=
3.239%, /?service=video.video.shareVideo&id=
2.834%, /?service=Stationmessage.StationNotice.getNewStationNoticeCenter&userId=&isCount=
2.429%, /?service=Live.Live.getNewHotList&userId=&page=&limit=&deviceNo=
2.429%, /?service=Live.video.getVideoLists&page=&type=hot
2.429%, /?service=video.video.getVideoLists&uid=&page=
2.024%, /?service=Live.Live.getNewFollowList&userId=&page=&limit=
2.024%, /?service=Live.Live.getNewFollowList&userId=&page=&limit=
2.024%, /?service=Live.anchor.followAnchorList&userId=&page=&limit=
2.024%, /?service=Live.live.getNewFollowList&userId=&page=&limit=
1.619%, /?service=Shop.index.getIndexInfo
1.619%, /?service=Live.live.getNewFollowList&page=&limit=
1.619%, /?service=user.users.passLogin
1.215%, /?service=standard.verify.verifyMobileIsReg&mobile=
1.215%, /?service=video.video.getVideoLists&uid=&page=&type=
-- of is hidden
Uri filtered:
Uri pattern total:
19.028%, /?service=Stationmessage.StationNotice.getNewStationNoticeCenter&userId=[-]&isCount=[-]
12.146%, /?service=Live.Live.getNewFollowList&userId=[-]&page=[-]&limit=[-]
8.097%, /?service=standard.options.getConfig&siteOptions=download_app
8.097%, /?service=Live.Live.getNewHotList&userId=[-]&page=[-]&limit=[-]&deviceNo=
8.097%, /?service=user.users.getInfoById&userId=[-]
6.478%, /?service=Live.live.getNewFollowList&userId=[-]&page=[-]&limit=[-]
6.478%, /?service=Live.anchor.followAnchorList&userId=[-]&page=[-]&limit=[-]
4.858%, /?service=user.users.getUserInfoNumber&userId=[-]
4.049%, /?service=video.video.getVideoLists&uid=[-]&page=[-]
3.644%, /?service=video.video.getVideoLists&uid=[-]&page=[-]&type=[-]
3.239%, /?service=video.video.shareVideo&id=[-]
2.429%, /?service=Live.video.getVideoLists&page=[-]&type=hot
2.024%, /?service=live.Anchor.starRankList&userId=[-]&page=[-]&type=[-]
1.619%, /?service=Live.live.getNewFollowList&page=[-]&limit=[-]
1.619%, /?service=user.users.passLogin
1.619%, /?service=standard.verify.verifyMobileIsReg&mobile=[-]
1.619%, /?service=user.users.accountLog&userId=[-]&page=[-]&limit=[-]
1.619%, /?service=Shop.index.getIndexInfo
0.810%, /?service=user.users.updateInfo
0.810%, /?service=user.users.newPersonalDetails&userId=[-]&selectId=[-]
0.810%, /?service=Live.Live.getLiveList&cateId=[-]&userId=[-]&page=[-]&limit=[-]
0.405%, /?service=video.video.getVideoLists&page=[-]
-- of is hidden
Uri pattern filtered:

更多用法参考:

[root@localhost ~]# ./xlog -h