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 Input]fixes issues with mapstring against JSONObject config #19069

Merged
merged 2 commits into from
Jun 9, 2020

Conversation

P1llus
Copy link
Member

@P1llus P1llus commented Jun 9, 2020

What does this PR do?

This change resolves an error when using "json_objects_array" configuration option. Currently the feature does not work due to mm always being nil

Why is it important?

Fixes a currently unusable feature

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.

@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 9, 2020
@marc-gr
Copy link
Contributor

marc-gr commented Jun 9, 2020

Would be possible to add a small test for it? Other than that LGTM 👍

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jun 9, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #19069 updated]

  • Start Time: 2020-06-09T11:37:35.464+0000

  • Duration: 57 min 34 sec

Test stats 🧪

Test Results
Failed 0
Passed 2230
Skipped 382
Total 2612

@P1llus
Copy link
Member Author

P1llus commented Jun 9, 2020

Would be possible to add a small test for it? Other than that LGTM 👍

Done, ran all tests which passed, the new test would look like this, also tested with modifying it to fail, which it also did if it was incorrect:

=== RUN   TestArrayResponse
2020-06-09T13:33:30.122+0200	INFO	[httpjson]	httpjson/input.go:108	Initialized httpjson input.	{"url": "http://127.0.0.1:44945"}
--- PASS: TestArrayResponse (0.00s)

@andrewkroh
Copy link
Member

Relates: #18919 (comment)

This will partially address my reported issue (pagination is still a problem for the scroll example).

@marc-gr marc-gr merged commit 6d91d9f into elastic:master Jun 9, 2020
marc-gr pushed a commit to marc-gr/beats that referenced this pull request Jun 9, 2020
…ect config (elastic#19069)

* fixes issues with mapstring against JSONobject, mm is always nil

* added test for array response working

(cherry picked from commit 6d91d9f)
@marc-gr marc-gr added the v7.7.2 label Jun 9, 2020
marc-gr pushed a commit to marc-gr/beats that referenced this pull request Jun 9, 2020
…ect config (elastic#19069)

* fixes issues with mapstring against JSONobject, mm is always nil

* added test for array response working

(cherry picked from commit 6d91d9f)
@marc-gr marc-gr added the v7.8.0 label Jun 9, 2020
marc-gr pushed a commit to marc-gr/beats that referenced this pull request Jun 9, 2020
…ect config (elastic#19069)

* fixes issues with mapstring against JSONobject, mm is always nil

* added test for array response working

(cherry picked from commit 6d91d9f)
@marc-gr marc-gr added the v7.9.0 label Jun 9, 2020
marc-gr added a commit that referenced this pull request Jun 10, 2020
…ect config (#19069) (#19075)

* fixes issues with mapstring against JSONobject, mm is always nil

* added test for array response working

(cherry picked from commit 6d91d9f)

Co-authored-by: Marius Iversen <pillus@chasenet.org>
marc-gr added a commit that referenced this pull request Jun 10, 2020
…ect config (#19069) (#19077)

* fixes issues with mapstring against JSONobject, mm is always nil

* added test for array response working

(cherry picked from commit 6d91d9f)

Co-authored-by: Marius Iversen <pillus@chasenet.org>
marc-gr added a commit that referenced this pull request Jun 10, 2020
…ect config (#19069) (#19076)

* fixes issues with mapstring against JSONobject, mm is always nil

* added test for array response working

(cherry picked from commit 6d91d9f)

Co-authored-by: Marius Iversen <pillus@chasenet.org>
@P1llus P1llus deleted the httpjson_array_fix branch June 10, 2020 09:24
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this pull request Oct 14, 2020
…ect config (elastic#19069)

* fixes issues with mapstring against JSONobject, mm is always nil

* added test for array response working
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…ect config (elastic#19069) (elastic#19075)

* fixes issues with mapstring against JSONobject, mm is always nil

* added test for array response working

(cherry picked from commit d1db38e)

Co-authored-by: Marius Iversen <pillus@chasenet.org>
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