Graylog2 / Graylog2/graylog2-server
Grok pattern COMMONAPACHELOG fails to parse the REMOTE_USER (%u) if it is in email address format
- Dominant language
- Java
- Stars
- 8.1k
- Forks
- 1.1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 217
Description
[https://httpd.apache.org/docs/2.4/mod/mod_log_config.html#formats](url) defines %u as _Remote user if the request was authenticated. May be bogus if return status (%s) is 401 (unauthorized)._
The Apache docs do not specify a particular format for the user name.
The Grok pattern is defined as:
%{IPORHOST:clientip} %{HTTPDUSER:ident} %{USER:auth} \[%{HTTPDATE
The bit dealing with %u is %{USER:auth} which is further defined as:
USER %{USERNAME}
USERNAME [a-zA-Z0-9._-]+
So the current Grok for _auth_ will fail to parse an auth field in the form of an email address due to the @ symbol
HTTPDUSER is defined as: %{EMAILADDRESS}\|%{USER}
If you substitute HTTPDUSER instead of USER then it will parse OK for both email addresses and usernames without @ in them.
Contributor guide
Assessment
This issue has not been assessed yet.