-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added http-x-forwarded-for field to nginx parser #1912
Conversation
test/plugin/test_parser_nginx.rb
Outdated
@@ -24,23 +25,23 @@ def create_driver | |||
|
|||
def test_parse | |||
d = create_driver | |||
d.instance.parse('127.0.0.1 192.168.0.1 - [28/Feb/2013:12:00:00 +0900] "GET / HTTP/1.1" 200 777 "-" "Opera/12.0"') { |time, record| | |||
d.instance.parse('127.0.0.1 192.168.0.1 - [28/Feb/2013:12:00:00 +0900] "GET / HTTP/1.1" 200 777 "-" "Opera/12.0" -') { |time, record| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change existing test because it is needed to check compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, this test will fail though if it won't be adapted to the nginx log format, how are you suggesting to overcome this issue? Create another test with the new format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create another test
Yes, creating new test is needed. Many users use nginx format so we can't break it. changing behaviour breaks user environment and causes log lost.
the new format?
One regular expression seems to support both with/without http_x_forwarded_for logs.
I've fixed the REGEXP to make the new field optional. I've also heed the advice of an SO answer and swapped |
|
Signed-off-by: yaron-idan <[email protected]>
OK, seems I'm gonna have to open a new PR since DCO rejects commits without a sign off, I'm gonna close this one and open a new one with the changes requested + a sign off. |
Closing #1907, an update to the docs has been proposed in fluent/fluentd-docs#471.