我試圖按年計算每月 日曆月(12月,1月,2月,...)網絡服務器的點擊次數。Python 2.7 - 查找網絡服務器點擊次數
我對Python很新,所以我甚至不知道從哪裏開始。我想你必須使用一些字符串拆分或正則表達式。
我給出以下輸出日誌文件:
[31/Dec/1994:23:55:08 -0700] "GET 45.html HTTP/1.0" 200 5489
remote - - [31/Dec/1994:23:56:55 -0700] "GET 2195.ps HTTP/1.0" 200 522318
remote - - [31/Dec/1994:23:59:37 -0700] "GET 957.ps HTTP/1.0" 200 122146
remote - - [01/Jan/1995:00:31:54 -0700] "GET index.html HTTP/1.0" 200 2797
remote - - [01/Jan/1995:00:31:58 -0700] "GET 2.gif HTTP/1.0" 200 2555
remote - - [01/Jan/1995:00:32:33 -0700] "GET 3.gif HTTP/1.0" 200 36403
remote - - [01/Jan/1995:01:39:21 -0700] "GET 20.html HTTP/1.0" 200 378
local - - [01/Jan/1995:01:47:41 -0700] "GET index.html HTTP/1.0" 200 2797
local - - [01/Jan/1995:01:47:49 -0700] "GET 39.html HTTP/1.0" 200 669
local - -
您的預期輸出是什麼? – 2015-04-03 06:34:17
我印象深刻你有一個20歲的日誌文件:p – 2015-04-03 07:25:30