2013-06-23 04:33:51 W3SVC1539885 198.56.185.162 GET /robots.txt - 80 - 66.249.75.65 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) 404 0 2
我想分别匹配日期2013-06-23/时间04:33:51/服务器ip198.56.185.162/文件地址robots.txt/蜘蛛ip66.249.75.65/蜘蛛信息Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html)/状态码404 0 2/,这个如何精确匹配?
我想分别匹配日期2013-06-23/时间04:33:51/服务器ip198.56.185.162/文件地址robots.txt/蜘蛛ip66.249.75.65/蜘蛛信息Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html)/状态码404 0 2/,这个如何精确匹配?
解决方案 »
- 企业网站源码里面每一个文件夹是代表什么功能,高手指导一下
- echo()简化语法?
- sprintf与mysql_real_escape_string问题?
- 咨询:百科wiki和问答开源系统哪些比较好?各位给推荐一个?
- 提问:php写的socket服务器端程序,性能、效率跟稳定性如何?
- 奇怪的问题
- 各位,奇怪的问题!事件查看器中可以看到insert的语句,sql放到查询分析器中执行也可以插入数据,但是程序就是没有插入数据!!!
- 本人今天开始学习PHP,看其中文文档,对其几个名词不是很明白,希望能解释一下!
- 关于UTF-8编码,header的一个问题
- php怎样连接到远端的oracle数据库?
- 用现成的程序好还是自主开发的好?
- 关于而面缓存的问题
$log = '2013-06-23 04:33:51 W3SVC1539885 198.56.185.162 GET /robots.txt - 80 - 66.249.75.65 Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html) 404 0 2';
var_dump( explode(' ', $log) );
/**
array(14) {
[0]=>
string(10) "2013-06-23"
[1]=>
string(8) "04:33:51"
[2]=>
string(12) "W3SVC1539885"
[3]=>
string(14) "198.56.185.162"
[4]=>
string(3) "GET"
[5]=>
string(11) "/robots.txt"
[6]=>
string(1) "-"
[7]=>
string(2) "80"
[8]=>
string(1) "-"
[9]=>
string(12) "66.249.75.65"
[10]=>
string(72) "Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html)"
[11]=>
string(3) "404"
[12]=>
string(1) "0"
[13]=>
string(1) "2"
}
*/