我掙扎創建Apache日誌正則表達式。我使用的日誌格式如下。簡單的regex幫助
我希望能夠匹配任何詞或短語,其中「/city/index.html」是。
66-121-89-14.domain.com - - [14/Apr/2011:14:47:05 +0100] "GET /city/index.html HTTP/1.1" 200 2577 "http://www.domain.com/referrer/" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16"
可以一個正則表達式高手請幫忙?
--edit--
這是fail2ban上的ignoreregex。我真的希望能夠像/house
那樣捕獲該目錄中的所有文件或/house/jonross.html
以專門匹配該HTML文件。再次感謝。
我不知道這是否幫助,但我已經注意到,谷歌已經細化罐頭幫助解析Apache日誌http://code.google.com/p/google-refine/觀看視頻,非常容易使用 – 2011-04-15 19:38:10
謝謝你的提示。 – 2011-04-15 19:39:57
你如何定義一個短語?你使用grep嗎?你想用'/ city/index.html'匹配任何一行嗎?還是你想做更多? – 2011-04-15 19:40:17