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

Support running multiple log groups in cloudwatch input #29695

Merged
merged 13 commits into from
Jan 25, 2022
Merged

Support running multiple log groups in cloudwatch input #29695

merged 13 commits into from
Jan 25, 2022

Conversation

kaiyan-sheng
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng commented Jan 4, 2022

What does this PR do?

This PR is to fix aws-cloudwatch input when log_group_name_prefix config parameter is given. With this PR, we should be able to specify a number_of_workers to control how many workers are running at the same time. This also represents how many log groups are being accessed at the same time to collect logs.

This PR also migrates the aws-cloudwatch input to use Filebeat Input V2 and added integration test for it.

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.

How to test this PR locally

In your test AWS environment, create several log groups starting with the same name, such as /foo/test/log_group_1, /foo/test/log_group_2 and etc. Also, create some log entries for testing. Then edit filebeat.yml to use the aws-cloudwatch input to read logs:

filebeat.inputs:
- type: aws-cloudwatch
  enabled: true
  credential_profile_name: elastic-beats
  log_group_name_prefix: /kaiyan/test
  region_name: us-east-1
  number_of_workers: 2

Related issues

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 4, 2022
@kaiyan-sheng kaiyan-sheng self-assigned this Jan 4, 2022
@mergify
Copy link
Contributor

mergify bot commented Jan 4, 2022

This pull request does not have a backport label. Could you fix it @kaiyan-sheng? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Jan 4, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jan 4, 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-01-25T03:54:46.436+0000

  • Duration: 180 min 20 sec

  • Commit: 3e4060f

Test stats 🧪

Test Results
Failed 0
Passed 20999
Skipped 797
Total 21796

💚 Flaky test report

Tests succeeded.

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

@kaiyan-sheng kaiyan-sheng added the Team:Integrations Label for the Integrations team label Jan 6, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 6, 2022
@mergify
Copy link
Contributor

mergify bot commented Jan 13, 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_cloudwatch_input upstream/fix_cloudwatch_input
git merge upstream/master
git push upstream fix_cloudwatch_input

@kaiyan-sheng kaiyan-sheng marked this pull request as ready for review January 14, 2022 03:41
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@aspacca
Copy link
Contributor

aspacca commented Jan 19, 2022

great refactoring! 👍

@mergify
Copy link
Contributor

mergify bot commented Jan 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_cloudwatch_input upstream/fix_cloudwatch_input
git merge upstream/master
git push upstream fix_cloudwatch_input

@kaiyan-sheng kaiyan-sheng added the backport-v8.0.0 Automated backport with mergify label Jan 25, 2022
@kaiyan-sheng kaiyan-sheng removed the backport-skip Skip notification from the automated backport with mergify label Jan 25, 2022
@kaiyan-sheng kaiyan-sheng merged commit ea8f10c into elastic:master Jan 25, 2022
@kaiyan-sheng kaiyan-sheng deleted the fix_cloudwatch_input branch January 25, 2022 15:15
mergify bot pushed a commit that referenced this pull request Jan 25, 2022
kaiyan-sheng added a commit that referenced this pull request Jan 25, 2022
)

(cherry picked from commit ea8f10c)

Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
yashtewari pushed a commit to build-security/beats that referenced this pull request Jan 30, 2022
@kaiyan-sheng kaiyan-sheng added the backport-7.17 Automated backport to the 7.17 branch with mergify label Feb 23, 2022
@kaiyan-sheng
Copy link
Contributor Author

@Mergifyio backport 7.17

@mergify
Copy link
Contributor

mergify bot commented Feb 23, 2022

backport 7.17

❌ No backport have been created

  • Backport to branch 7.17 failed: Git reported the following error:
fatal: couldn't find remote ref master

@RobsonSutton
Copy link

@kaiyan-sheng & @v1v - Hey 👋 Quick question if that's okay:
From the looks of the above, the aws-cloudwatch bug fix wasn't successfully backported to v7.17.x.
Do you know if this would be achievable at all? e.g. cherry pick the commits to point at 7.17.x and merge this under a separate PR or something?

@olivierots
Copy link

@kaiyan-sheng & @v1v - Hey 👋 Quick question if that's okay: From the looks of the above, the aws-cloudwatch bug fix wasn't successfully backported to v7.17.x. Do you know if this would be achievable at all? e.g. cherry pick the commits to point at 7.17.x and merge this under a separate PR or something?

@kaiyan-sheng - please let us know if this is possible ^^ currently experiencing the same problem as Robson

kaiyan-sheng added a commit that referenced this pull request Jul 6, 2022
@kaiyan-sheng
Copy link
Contributor Author

Hello, I backported this PR into 7.17 so it should be released with 7.17.6 version.

@RobsonSutton
Copy link

@kaiyan-sheng - You absolute star 🌟 Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7.17 Automated backport to the 7.17 branch with mergify backport-v8.0.0 Automated backport with mergify Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Filebeat 7.14.2] Adding log_group_name_prefix in aws-cloudwatch input
6 participants