您好,欢迎访问一九零五行业门户网

一个统计数据的有关问题 求指点

一个统计数据的问题 求指点
113.64.79.0 - - [04/jul/2012:10:03:41 +0800] get /upfile/201207/201207040939177110.jpg http/1.1 200 18315 http://www.liketry.com/paytry.php mozilla/4.0 (compatible; msie 8.0; windows nt 5.1; trident/4.0; .net clr 2.0.50727; infopath.2; 360se) -
27.115.127.146 - - [04/jul/2012:10:03:41 +0800] get /images/default/fufei.png http/1.1 304 0 http://www.liketry.com/index.php mozilla/4.0 (compatible; msie 7.0; windows nt 5.1; trident/4.0; mozilla/4.0(compatible mozilla/4.0(compatible-embeddedwb 14.59 http://bsalsa.com/ embeddedwb- 14.59 from: http://bsalsa.com/ ; .net clr 2.0.50727; .net clr 3.0.04506.648; .net clr 3.5.21022; .net clr 1.1.4322; maxthon 2.0) -
116.21.255.71 - - [04/jul/2012:10:03:41 +0800] get /images/ui-bg_glass_100_f6f6f6_1x400.png http/1.1 200 1009 http://www.liketry.com/user_login.php?returnurl=http%3a%2f%2fwww.liketry.com%2fget_password.php%3fmail%3d512695867%40qq.com%26&rr=0&loginuname=512695867@qq.com&error=5a+g56cb6zsz6k+v mozilla/4.0 (compatible; msie 8.0; windows nt 5.1; trident/4.0; sv1; .net clr 2.0.50727; 360se) -
类似这种记录 一个 有 一万条 
我取了三条 
我需要 从这些数据中 的到 做例子 字符串中 http: xxxx 前面的 那个流量数据 
求方法
------解决方案--------------------
php code// 这个实现有多种方法,现在列出其中的一种preg_match_all('/\get[ ]*\/upfile[^ ]+[ ]+http\/1\.1\[ ]+\w+[ ]+(\d+)[ ]+\/', $s, $a1);preg_match_all('/\get[ ]*\/(?!upfile)[^ ]+[ ]+http\/1\.1\[ ]+(\d+)[ ]+(\d+)[ ]+\/', $s, $a2);//p($a1);p($a2);
------解决方案--------------------
日志是一行一行的, 这种统计太基础了, awk/cut/php按空白分割取第n段就行了。

其它类似信息

推荐信息