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

[Filebeat] httplog - reduce duplication to shrink log message size #36531

Conversation

andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Sep 7, 2023

Proposed commit message

The request and response bodies are included twice in request tracer messages. The body appears in both the event.original and http.{request,response}.body.content. This removes the body from the event.original. It should help reduce the log message sizes for large responses.

The motivation is to allow larger responses to fit into the request tracer log. When a log message exceeds the max size of a log (default 1 MiB) then the message is dropped and a warning is logged by zap to stderr.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

@andrewkroh andrewkroh requested a review from a team as a code owner September 7, 2023 03:14
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 7, 2023
@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 7, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 7, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @andrewkroh? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

The request and response bodies are included twice in request tracer messages.
The body appears in both the event.original and http.{request,response}.body.content.
This removes the body from the event.original. It should help reduce the log message
sizes for large responses.
@andrewkroh andrewkroh force-pushed the feature/fb/httplog-no-body-in-event-original branch from bed727b to c2ea764 Compare September 7, 2023 03:17
@andrewkroh andrewkroh added the backport-skip Skip notification from the automated backport with mergify label Sep 7, 2023
@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 7, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-09-07T11:20:00.530+0000

  • Duration: 74 min 47 sec

Test stats 🧪

Test Results
Failed 0
Passed 3177
Skipped 174
Total 3351

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Contributor

mergify bot commented Sep 7, 2023

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feature/fb/httplog-no-body-in-event-original upstream/feature/fb/httplog-no-body-in-event-original
git merge upstream/main
git push upstream feature/fb/httplog-no-body-in-event-original

@andrewkroh andrewkroh enabled auto-merge (squash) September 7, 2023 11:19
@andrewkroh andrewkroh merged commit 8d3aa91 into elastic:main Sep 7, 2023
8 checks passed
Scholar-Li pushed a commit to Scholar-Li/beats that referenced this pull request Feb 5, 2024
The request and response bodies are included twice in request tracer messages.
The body appears in both the event.original and http.{request,response}.body.content.
This removes the body from the event.original. It should help reduce the log message
sizes for large responses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Skip notification from the automated backport with mergify Filebeat Filebeat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants