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

Update filebeat httpjson input to support pagination via Header and Okta module #16354

Merged
merged 21 commits into from
Mar 11, 2020
Merged

Update filebeat httpjson input to support pagination via Header and Okta module #16354

merged 21 commits into from
Mar 11, 2020

Conversation

alakahakai
Copy link

@alakahakai alakahakai commented Feb 14, 2020

Update filebeat httpjson input to support:

  • Pagination via HTTP Header fields and regexp based matching
  • Rate limit via HTTP Header fields
  • Okta module

@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

I think it would be good to try to split some of these larger functions into some smaller ones that can be more easily unit tested. processHTTPRequest is getting kind of long and doesn't have high test coverage.

The new config parameters need to be added to the docs.

x-pack/filebeat/input/httpjson/input.go Outdated Show resolved Hide resolved
x-pack/filebeat/input/httpjson/input.go Outdated Show resolved Hide resolved
x-pack/filebeat/input/httpjson/input.go Outdated Show resolved Hide resolved
x-pack/filebeat/input/httpjson/input.go Outdated Show resolved Hide resolved
x-pack/filebeat/input/httpjson/config.go Show resolved Hide resolved
x-pack/filebeat/input/httpjson/input.go Outdated Show resolved Hide resolved
x-pack/filebeat/input/httpjson/config.go Outdated Show resolved Hide resolved
x-pack/filebeat/input/httpjson/input.go Outdated Show resolved Hide resolved
x-pack/filebeat/input/httpjson/input.go Outdated Show resolved Hide resolved
x-pack/filebeat/input/httpjson/input.go Outdated Show resolved Hide resolved
x-pack/filebeat/input/httpjson/config.go Outdated Show resolved Hide resolved
x-pack/filebeat/input/httpjson/config.go Outdated Show resolved Hide resolved
x-pack/filebeat/input/httpjson/config.go Outdated Show resolved Hide resolved
x-pack/filebeat/input/httpjson/input.go Outdated Show resolved Hide resolved
x-pack/filebeat/input/httpjson/input.go Outdated Show resolved Hide resolved
@alakahakai alakahakai changed the title Update filebeat httpjson input to support pagination via Header and OKTA module Update filebeat httpjson input to support pagination via Header and Okta module Mar 3, 2020
Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

I see no issues with the changes 👍 . Can you please add some tests for the new features. The rate limiting, pagination, and config validation code doesn't get much exercise 🚲 in the tests. It might be easier to test some of cases if you can split the code into pieces that can be synchronously unit tested.

@andrewkroh
Copy link
Member

Thank you for adding config validation test cases. Are you able to add some test coverage for the applyRateLimit and the pagination block in processHTTPRequest?

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

Thank you for adding more tests. LGTM. Just one minor comment.

x-pack/filebeat/input/httpjson/input.go Outdated Show resolved Hide resolved
@alakahakai alakahakai merged commit a6a2d49 into elastic:master Mar 11, 2020
@alakahakai alakahakai added the needs_backport PR is waiting to be backported to other branches. label Apr 10, 2020
@alakahakai alakahakai added v7.8.0 and removed needs_backport PR is waiting to be backported to other branches. labels Apr 10, 2020
alakahakai pushed a commit that referenced this pull request Apr 10, 2020
…pagination via Header and Okta module (#17669)

* Update filebeat httpjson input to support pagination via Header and Okta module (#16354)

* Update filebeat httpjson input to support pagination via Header and Okta module

(cherry picked from commit a6a2d49)

* Update CHANGELOG.next.asciidoc
alakahakai pushed a commit that referenced this pull request Apr 10, 2020
…pagination via Header and Okta module (#17670)

* Update filebeat httpjson input to support pagination via Header and Okta module (#16354)

* Update filebeat httpjson input to support pagination via Header and Okta module

(cherry picked from commit a6a2d49)

* Update CHANGELOG.next.asciidoc
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…upport pagination via Header and Okta module (elastic#17670)

* Update filebeat httpjson input to support pagination via Header and Okta module (elastic#16354)

* Update filebeat httpjson input to support pagination via Header and Okta module

(cherry picked from commit 994e1f1)

* Update CHANGELOG.next.asciidoc
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.

3 participants