Skip to content

Commit

Permalink
integrate CONNECT proxy method parsing to common/combined parser
Browse files Browse the repository at this point in the history
  • Loading branch information
philhagen committed Oct 23, 2018
1 parent 11a83e3 commit c9cbc15
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
3 changes: 0 additions & 3 deletions configfiles/6100-httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,18 @@ filter {
match => { "message" =>
[
# syslog-based entries, as used on my own servers (HTTP access log pushed via syslog messages)
"%{SYSLOGTIMESTAMP} (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{SYSLOGPROG}: %{HOSTNAME:hostname} %{PROXYCONNECT}",
"%{SYSLOGTIMESTAMP} (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{SYSLOGPROG}: %{HOSTNAME:hostname} %{COMBINEDPROXYLOG_CUSTOM}",
"%{SYSLOGTIMESTAMP} (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{SYSLOGPROG}: %{HOSTNAME:hostname} %{COMMONPROXYLOG_CUSTOM}",
"%{SYSLOGTIMESTAMP} (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{SYSLOGPROG}: %{HOSTNAME:hostname} %{COMBINEDAPACHELOG_CUSTOM}",
"%{SYSLOGTIMESTAMP} (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{SYSLOGPROG}: %{HOSTNAME:hostname} %{COMMONAPACHELOG_CUSTOM}",

# live syslog-based data, partially parsed via the syslog{} input selector
"%{HOSTNAME:hostname} %{PROXYCONNECT}",
"%{HOSTNAME:hostname} %{COMBINEDPROXYLOG_CUSTOM}",
"%{HOSTNAME:hostname} %{COMMONPROXYLOG_CUSTOM}",
"%{HOSTNAME:hostname} %{COMBINEDAPACHELOG_CUSTOM}",
"%{HOSTNAME:hostname} %{COMMONAPACHELOG_CUSTOM}",

# straight-out NCSA combined/common formats. combined has to go first, since common will match a combined entry as well - and we break on first match
"%{PROXYCONNECT}",
"%{COMBINEDPROXYLOG_CUSTOM}",
"%{COMMONPROXYLOG_CUSTOM}",
"%{COMBINEDAPACHELOG_CUSTOM}",
Expand Down
3 changes: 1 addition & 2 deletions grok-patterns/for572_custom
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ URIPATH_CUSTOM %{URIPATH}|\*

# custom HTTPD common format (should flow to the combined format) to allow email address as the username, separate out query string from stub request
HTTPDUSER %{EMAILADDRESS}|%{USER}
COMMONAPACHELOG_CUSTOM %{IPORHOST:source_ip} %{USER:ident} %{HTTPDUSER:username} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:request_method} (?:%{WORD:protocol}://%{HOSTNAME:hostname}(?::%{POSINT:destination_port})?)?%{URIPATH_CUSTOM:request}(?:\?%{NOTSPACE:query_string})?(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response_code} (?:%{NUMBER:destination_bytes}|-)
COMMONAPACHELOG_CUSTOM %{IPORHOST:source_ip} %{USER:ident} %{HTTPDUSER:username} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:request_method} (?:%{WORD:protocol}://)?(?:%{HOSTNAME:hostname}(?::%{POSINT:destination_port})?)?(?:%{URIPATH_CUSTOM:request})?(?:\?%{NOTSPACE:query_string})?(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response_code} (?:%{NUMBER:destination_bytes}|-)
COMMONPROXYLOG_CUSTOM %{COMMONAPACHELOG_CUSTOM} %{WORD:proxy_cachestatus}:%{WORD:proxy_hierarchystatus}
COMBINEDAPACHELOG_CUSTOM (?:%{COMMONAPACHELOG_CUSTOM}) %{QS:referrer} %{QS:agent}
COMBINEDPROXYLOG_CUSTOM %{COMBINEDAPACHELOG_CUSTOM} %{WORD:proxy_cachestatus}:%{WORD:proxy_hierarchystatus}
PROXYCONNECT %{WORD:request_method} %{HOSTNAME:hostname}:%{POSINT:destination_port} HTTP/%{NUMBER:httpversion}

# hours:minutes:seconds, to allow any number of hours
HMS (?:[0-9]+):%{MINUTE}(?::%{SECOND})(?![0-9])
Expand Down

0 comments on commit c9cbc15

Please sign in to comment.