Skip to content
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

Cherry-pick #8768 to 6.5: Update Filebeat Traefik module to handle mixed Common and Combined Log Format #9439

Merged
merged 2 commits into from
Dec 10, 2018

Conversation

sayden
Copy link
Contributor

@sayden sayden commented Dec 7, 2018

Cherry-pick of PR #8768 to 6.5 branch. Original message:

This is a continuation of PRs #6488 and #6136

Previous PR's were misleading because there's no difference between Traefik 1.5 and 1.7 log formats but as you can see in this issue Traefik could miss some quote which would make our parser to fail. So those PR's were to address that issue.

Traefik uses by default since 1.4 version (at least) the Combined Log Format https://httpd.apache.org/docs/trunk/logs.html#combined also used in Apache. In 1.7 it still uses this format but you can also setup Common Log Format or JSON. Maybe we should open an issue to support JSON in the future.

Solves #8015 and #6111

  • frontend_name field was added so Traefik frontend_name is missing #8015 is solved.
  • The Grok pattern have been improved to handle the case of Traefik module for Filebeat is not working as expected #6111 and the log lines described there have been added to the test cases successfully so the issue is also solved.
  • Added user_identifier field which was hardcoded to '-' before
  • Added duration field which was missing too
  • Added request_count field
  • Numeric fields added as string have been converted to long like response_code

…g Format (elastic#8768)

 * Added support for Common Log Format and Combined Log Format in Traefik which is the default format until now.
* Added more log lines, including one in Common Log Format
* Added user_identifier field which was hardcoded to '-' before
* Added log test inputs where the user_name and user_identifier were set and not set.
* Added duration field which was missing
* Numeric fields added as string have been converted to long
* Added request count field
* Added two log lines more that covers issue elastic#6111
* Make bytes_sent field of type long. Most Grok expressions are optional now
* Added CHANGELOG entry

(cherry picked from commit 0e9054c)

fields.go file is updated and pre-ECS generated JSON expected file which differs from master is used

# Conflicts:
#	filebeat/include/fields.go
#	filebeat/module/traefik/access/test/test.log-expected.json
@@ -64,6 +64,10 @@ https://github.com/elastic/beats/compare/v6.5.2...6.5[Check the HEAD diff]

*Filebeat*

- Added `detect_null_bytes` selector to detect null bytes from a io.reader. {pull}9210[9210]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems the rebase mess up the backport a bit. Can you clean this up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lesson learnt. Even when you expect an almost clean rebase, double check changes.

@sayden sayden merged commit 84ef7f0 into elastic:6.5 Dec 10, 2018
@sayden sayden deleted the backport_8768_6.5 branch October 29, 2021 08:56
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…ndle mixed Common and Combined Log Format (elastic#9439)

* Update Filebeat Traefik module to handle mixed Common and Combined Log Format (elastic#8768)

 * Added support for Common Log Format and Combined Log Format in Traefik which is the default format until now.
* Added more log lines, including one in Common Log Format
* Added user_identifier field which was hardcoded to '-' before
* Added log test inputs where the user_name and user_identifier were set and not set.
* Added duration field which was missing
* Numeric fields added as string have been converted to long
* Added request count field
* Added two log lines more that covers issue elastic#6111
* Make bytes_sent field of type long. Most Grok expressions are optional now
* Added CHANGELOG entry

(cherry picked from commit 5db2afb)

fields.go file is updated and pre-ECS generated JSON expected file which differs from master is used

# Conflicts:
#	filebeat/include/fields.go
#	filebeat/module/traefik/access/test/test.log-expected.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants