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][httpjson] Add date_cursor to httpjson input #19483

Merged
merged 6 commits into from
Jul 1, 2020

Conversation

marc-gr
Copy link
Contributor

@marc-gr marc-gr commented Jun 29, 2020

What does this PR do?

Adds the ability to set a date_cursor in httpjson input. This can be used to make date based requests to the endpoint.

Why is it important?

To prevent requesting big amounts of events, or repeated events from APIs.

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.

Not sure if adding it to docs or not, since this is meant for very specific use cases for now.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jun 29, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jun 29, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #19483 updated]

  • Start Time: 2020-07-01T09:31:11.028+0000

  • Duration: 31 min 23 sec

Test stats 🧪

Test Results
Failed 0
Passed 547
Skipped 127
Total 674

@marc-gr marc-gr added the in progress Pull request is currently in progress. label Jun 29, 2020
@marc-gr marc-gr force-pushed the filebeat_httpjson_add_date_cursor branch from 300e894 to e4a5c6a Compare June 29, 2020 15:28
@marc-gr marc-gr added review and removed in progress Pull request is currently in progress. labels Jun 29, 2020
Copy link
Member

@P1llus P1llus left a comment

Choose a reason for hiding this comment

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

Few comments but except that LGTM, though would need more reviews than me.

x-pack/filebeat/input/httpjson/config.go Show resolved Hide resolved
x-pack/filebeat/input/httpjson/input.go Show resolved Hide resolved
@P1llus
Copy link
Member

P1llus commented Jun 30, 2020

Tested this with the ATP module and seems to be working just fine

@marc-gr marc-gr force-pushed the filebeat_httpjson_add_date_cursor branch from 9fc80d0 to d4b655a Compare June 30, 2020 10:58
@marc-gr
Copy link
Contributor Author

marc-gr commented Jun 30, 2020

Added date_cursor.date_format validation and error message for cursor getfield errors.

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.

LGTM. Looks like it covers exactly the cases needed for now.

@marc-gr marc-gr force-pushed the filebeat_httpjson_add_date_cursor branch from d4b655a to 09d408a Compare July 1, 2020 08:30
@marc-gr marc-gr force-pushed the filebeat_httpjson_add_date_cursor branch from 3c9b5e0 to d04d3fe Compare July 1, 2020 09:30
@marc-gr marc-gr merged commit 775f134 into elastic:master Jul 1, 2020
@marc-gr marc-gr deleted the filebeat_httpjson_add_date_cursor branch July 1, 2020 10:32
@marc-gr marc-gr added the needs_backport PR is waiting to be backported to other branches. label Jul 1, 2020
marc-gr added a commit to marc-gr/beats that referenced this pull request Jul 14, 2020
* Add date_cursor to httpjson input

* Add changelog entry

* Fix tests

* Default to UTC date

* Add date_cursor validations and better error message

* Run fmt update

(cherry picked from commit 775f134)
@marc-gr marc-gr removed the needs_backport PR is waiting to be backported to other branches. label Jul 14, 2020
marc-gr added a commit that referenced this pull request Jul 14, 2020
* Add date_cursor to httpjson input

* Add changelog entry

* Fix tests

* Default to UTC date

* Add date_cursor validations and better error message

* Run fmt update

(cherry picked from commit 775f134)
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this pull request Oct 14, 2020
* Add date_cursor to httpjson input

* Add changelog entry

* Fix tests

* Default to UTC date

* Add date_cursor validations and better error message

* Run fmt update
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.

4 participants