Cherry-pick #8768 to 6.5: Update Filebeat Traefik module to handle mixed Common and Combined Log Format#9439
Merged
sayden merged 2 commits intoelastic:6.5from Dec 10, 2018
Merged
Conversation
…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
ruflin
reviewed
Dec 7, 2018
CHANGELOG.asciidoc
Outdated
|
|
||
| *Filebeat* | ||
|
|
||
| - Added `detect_null_bytes` selector to detect null bytes from a io.reader. {pull}9210[9210] |
Contributor
There was a problem hiding this comment.
Seems the rebase mess up the backport a bit. Can you clean this up?
Contributor
Author
There was a problem hiding this comment.
Lesson learnt. Even when you expect an almost clean rebase, double check changes.
ruflin
approved these changes
Dec 10, 2018
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_namefield was added so Traefik frontend_name is missing #8015 is solved.user_identifier fieldwhich was hardcoded to '-' beforedurationfield which was missing toorequest_countfieldresponse_code