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][module][elastisearch] exclude gc and audit log from server fileset #32781

Merged
merged 3 commits into from
Sep 13, 2022

Conversation

alioug
Copy link
Contributor

@alioug alioug commented Aug 23, 2022

What does this PR do?

Fix filebeat sending gc.log even if gc fileset is disabled

Why is it important?

gc.log is verbose and unnecessarily fills filebeat indices/data streams

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.

Author's Checklist

  • Check gc.log is sended when gc fileset is enabled

How to test this PR locally

Install filebeat and elasticsearch locally, only enable server fileset (disable gc fileset) and check in filebeat indices there is no more gc logs.

Related issues

Use cases

Screenshots

Logs

@alioug alioug requested a review from a team as a code owner August 23, 2022 15:26
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Aug 23, 2022
@mergify mergify bot assigned alioug Aug 23, 2022
@mergify
Copy link
Contributor

mergify bot commented Aug 23, 2022

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 fix-filebeat-es-module upstream/fix-filebeat-es-module
git merge upstream/main
git push upstream fix-filebeat-es-module

@mergify
Copy link
Contributor

mergify bot commented Aug 23, 2022

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @alioug? 🙏.
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

@matschaffer matschaffer added the Team:Infra Monitoring UI - DEPRECATED Infrastructure Monitoring UI team - DEPRECATED - Use Team:Monitoring label Aug 23, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Aug 23, 2022
@alioug alioug force-pushed the fix-filebeat-es-module branch from 5c131cf to cb07ae3 Compare August 24, 2022 07:24
@elasticmachine
Copy link
Collaborator

elasticmachine commented Aug 24, 2022

💚 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: 2022-09-13T02:50:54.506+0000

  • Duration: 12 min 7 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 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!)

@alioug alioug marked this pull request as draft August 24, 2022 07:29
@alioug alioug marked this pull request as ready for review August 24, 2022 07:47
@mergify
Copy link
Contributor

mergify bot commented Aug 24, 2022

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 fix-filebeat-es-module upstream/fix-filebeat-es-module
git merge upstream/main
git push upstream fix-filebeat-es-module

@klacabane klacabane self-requested a review August 27, 2022 00:16
@klacabane
Copy link
Contributor

klacabane commented Aug 29, 2022

Another workaround would be specifying more precise path names in the filebeat configuration to avoid pulling unnecessary files, but it's great to add guards around the suggested defaults. Going that route we'd also have to filter out audit files right ? Yes it's mentioned in #30995 (comment)

@klacabane
Copy link
Contributor

@alioug are you still interested in merging this change ? We should also filter out audit logs to be exhaustive

@alioug
Copy link
Contributor Author

alioug commented Sep 7, 2022

yes of course, i will add the audit log file.

@alioug alioug force-pushed the fix-filebeat-es-module branch from a783e2c to fc4dbfd Compare September 7, 2022 12:08
@alioug alioug changed the title [Filebeat][module][elastisearch] exclude gc.log from server fileset [Filebeat][module][elastisearch] exclude gc and audit log from server fileset Sep 7, 2022
@klacabane
Copy link
Contributor

/test

Copy link
Contributor

@matschaffer matschaffer left a comment

Choose a reason for hiding this comment

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

At first I thought we should add rotated GC as well based on https://github.com/elastic/beats/blob/main/filebeat/module/elasticsearch/gc/manifest.yml#L6

But since the manifest default is *.log I think only the initial gc log will get picked up. LGTM!

@matschaffer
Copy link
Contributor

/test

@matschaffer matschaffer self-assigned this Sep 13, 2022
@matschaffer
Copy link
Contributor

I've assigned myself to this and the associated issue to make sure we merge it for @alioug once it's green.

@matschaffer
Copy link
Contributor

All green! Merging. Thanks for the fix @alioug !

@matschaffer matschaffer merged commit 11f4f22 into elastic:main Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Infra Monitoring UI - DEPRECATED Infrastructure Monitoring UI team - DEPRECATED - Use Team:Monitoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filebeat elasticsearch module sending gc.log even if only server submodule is enabled
4 participants