-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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] httpjson chain calls #29816
[Filebeat][httpjson] httpjson chain calls #29816
Conversation
This pull request does not have a backport label. Could you fix it @kush-elastic? 🙏
NOTE: |
This pull request is now in conflicts. Could you fix it? 🙏
|
Pinging @elastic/integrations (Team:Integrations) |
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
This pull request doesn't have a |
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
@@ -976,9 +1117,18 @@ image:images/input-httpjson-lifecycle.png[Request lifecycle] | |||
. The resulting transformed request is executed. | |||
. The server responds (here is where any retry or rate limit policy takes place when configured). | |||
. The response is transformed using the configured `response.transforms` and `response.split`. | |||
. If chain step is configured. step will generate new requests based on collected ids from responses. the requests will be transformed using configured `request.transforms`. resulting generated transformed requests will be executed. this process will happen for all the steps mentioned in chain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. If chain step is configured. step will generate new requests based on collected ids from responses. the requests will be transformed using configured `request.transforms`. resulting generated transformed requests will be executed. this process will happen for all the steps mentioned in chain. | |
. If a chain step is configured. Each step will generate new requests based on collected IDs from responses. The requests will be transformed using configured `request.transforms` and the resulting generated transformed requests will be executed. This process will happen for all the steps mentioned in the chain. |
. go back to step-2 for the next step. | ||
. publish collected responses from the last chain step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. go back to step-2 for the next step. | |
. publish collected responses from the last chain step. | |
. Go back to step-2 for the next step. | |
. Publish collected responses from the last chain step. |
setupServer: newChainTestServer(httptest.NewServer), | ||
baseConfig: map[string]interface{}{ | ||
"interval": 10, | ||
"request.method": "GET", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These instances of "GET"
should also be changed to http.MethodGet
(throughout this file).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but please wait for others.
/test |
* [filebeat][httpjson] Extend filebeat httpjson input for chained calls * Updates based on comments * Update on httpjson and nits * Resolve comments from Tiago * address comments and improved json_parser * Add entry to CHANGELOG.next.asciidoc * mage update and mage check for ci linting * address comments * Addressed comments * remove else as we have continue, close resp.Body in id collection mechanism and update json_parser to convert any type values to string * nits * mage check * Changes requested from elastic team * requested changes on logging level * requested changes for ids collection * Requested changes on input-httpjson.asciidoc and added tests for chain in input_test.go * Added regular tests with chain * Changes based on CI * Add New diagram for chain feature and updates based on CI changes * CI linter problem * removed unnecessary ci changes * golangci eventsCh->events * ignore few CI errors * update GET to http.MethodGet * Review changes- GET->http.MethodGet and nits (cherry picked from commit 2ec07f5) # Conflicts: # x-pack/filebeat/input/httpjson/pagination.go # x-pack/filebeat/input/httpjson/request.go # x-pack/filebeat/input/httpjson/response.go
@mtojek merging this PR might have broken the documentation, see https://elasticsearch-ci.elastic.co/blue/organizations/jenkins/elastic%2Bbeats%2Bpull-request%2Bbuild-docs/detail/elastic%20beats%20pull-request%20build-docs/13929/pipeline/ it's hard to tell the exact cause but at least I see these warnings
|
Hi @mtojek, @kush-elastic, The first issue is caused by this line: https://github.com/elastic/beats/pull/29816/files#diff-531162d76f10990e57691d2298a46f2aa2a4e576a8ec0d17dd1a37c35303983fR1040 (as the ID is already in use). |
@mtojek Why is this planned to be backported to 8.2? This is not a bug fix. |
@ruflin isn't after the feature freeze now? |
Sorry, I missed the review because I was on PTO. :/ Let's not worry too much about the documentation structure right now. We'll be moving to a new system and need to do some refactoring/cleanup as part of the migration, so let's handle layout issues then. |
* [filebeat][httpjson] Extend filebeat httpjson input for chained calls * Updates based on comments * Update on httpjson and nits * Resolve comments from Tiago * address comments and improved json_parser * Add entry to CHANGELOG.next.asciidoc * mage update and mage check for ci linting * address comments * Addressed comments * remove else as we have continue, close resp.Body in id collection mechanism and update json_parser to convert any type values to string * nits * mage check * Changes requested from elastic team * requested changes on logging level * requested changes for ids collection * Requested changes on input-httpjson.asciidoc and added tests for chain in input_test.go * Added regular tests with chain * Changes based on CI * Add New diagram for chain feature and updates based on CI changes * CI linter problem * removed unnecessary ci changes * golangci eventsCh->events * ignore few CI errors * update GET to http.MethodGet * Review changes- GET->http.MethodGet and nits
* [filebeat][httpjson] Extend filebeat httpjson input for chained calls * Updates based on comments * Update on httpjson and nits * Resolve comments from Tiago * address comments and improved json_parser * Add entry to CHANGELOG.next.asciidoc * mage update and mage check for ci linting * address comments * Addressed comments * remove else as we have continue, close resp.Body in id collection mechanism and update json_parser to convert any type values to string * nits * mage check * Changes requested from elastic team * requested changes on logging level * requested changes for ids collection * Requested changes on input-httpjson.asciidoc and added tests for chain in input_test.go * Added regular tests with chain * Changes based on CI * Add New diagram for chain feature and updates based on CI changes * CI linter problem * removed unnecessary ci changes * golangci eventsCh->events * ignore few CI errors * update GET to http.MethodGet * Review changes- GET->http.MethodGet and nits
* [filebeat][httpjson] Extend filebeat httpjson input for chained calls * Updates based on comments * Update on httpjson and nits * Resolve comments from Tiago * address comments and improved json_parser * Add entry to CHANGELOG.next.asciidoc * mage update and mage check for ci linting * address comments * Addressed comments * remove else as we have continue, close resp.Body in id collection mechanism and update json_parser to convert any type values to string * nits * mage check * Changes requested from elastic team * requested changes on logging level * requested changes for ids collection * Requested changes on input-httpjson.asciidoc and added tests for chain in input_test.go * Added regular tests with chain * Changes based on CI * Add New diagram for chain feature and updates based on CI changes * CI linter problem * removed unnecessary ci changes * golangci eventsCh->events * ignore few CI errors * update GET to http.MethodGet * Review changes- GET->http.MethodGet and nits
What does this PR do?
Why is it important?
For Example:
Salesforce: To collect eventLogFile from salesforce, we first need to collect logfile ids from Salesforce REST API and then use those logfile ids to collect more information from Salesforce.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
Related issues
Use cases