Skip to content

Commit 3236f51

Browse files
committed
Change: avoid referrer/user-agent quotes in apache logs
1 parent d8fcd88 commit 3236f51

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

patterns/httpd

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ HTTPDERROR_DATE %{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{YEAR}
33

44
# Log formats
55
HTTPD_COMMONLOG %{IPORHOST:clientip} (?:-|%{HTTPDUSER:ident}) (?:-|%{HTTPDUSER:auth}) \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" (?:-|%{NUMBER:response}) (?:-|%{NUMBER:bytes})
6-
HTTPD_COMBINEDLOG %{HTTPD_COMMONLOG} %{QS:referrer} %{QS:agent}
6+
HTTPD_COMBINEDLOG %{HTTPD_COMMONLOG} "(?:-|%{DATA:referrer})" "(?:-|%{DATA:agent})"
77

88
# Error logs
99
HTTPD20_ERRORLOG \[%{HTTPDERROR_DATE:timestamp}\] \[%{LOGLEVEL:loglevel}\] (?:\[client %{IPORHOST:clientip}\] ){0,1}%{GREEDYDATA:message}

spec/patterns/httpd_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
'httpversion' => '1.1',
2020
'response' => '200',
2121
'bytes' => '203023',
22-
'referrer' => '"http://semicomplete.com/presentations/logstash-monitorama-2013/"',
23-
'agent' => '"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"'
22+
'referrer' => 'http://semicomplete.com/presentations/logstash-monitorama-2013/',
23+
'agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36'
2424
)
2525
end
2626

0 commit comments

Comments
 (0)