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] Check expand_event_list_from_field before checking content-type #16441

Merged
merged 5 commits into from
Feb 26, 2020
Merged

[Filebeat] Check expand_event_list_from_field before checking content-type #16441

merged 5 commits into from
Feb 26, 2020

Conversation

kaiyan-sheng
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng commented Feb 19, 2020

What does this PR do?

This PR is to fix s3 input reading json format logs. When expand_event_list_from_field config is given, such as cloudtrail fileset, s3 input should use json.NewDecoder first. If this expand_event_list_from_field is not given, then check content-type and use gzip.NewReader.

Why is it important?

This will fix s3 input when using cloudtrail fileset.

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

Related issues

Screenshots

When Metadata is set as below:
Screen Shot 2020-02-19 at 3 02 48 PM

I was able to read the cloudtrail json.gz file as shown below in Kibana:
Screen Shot 2020-02-19 at 4 19 52 PM

@kaiyan-sheng kaiyan-sheng self-assigned this Feb 19, 2020
@kaiyan-sheng kaiyan-sheng added Filebeat Filebeat needs_backport PR is waiting to be backported to other branches. review Team:Platforms Label for the Integrations - Platforms team labels Feb 19, 2020
Copy link
Member

@ChrsMark ChrsMark left a comment

Choose a reason for hiding this comment

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

the code change lgtm!

I have a question if these config options and how all of them are combined and prioritised are documented for the users. Would this be useful? 🤔

@kaiyan-sheng
Copy link
Contributor Author

the code change lgtm!

I have a question if these config options and how all of them are combined and prioritized are documented for the users. Would this be useful? 🤔

Ahh good point! I don't think we have how these options combined and prioritized documented! Let me add some under expand_event_list_from_field. Thanks!

@kaiyan-sheng kaiyan-sheng merged commit 4bb8fa3 into elastic:master Feb 26, 2020
@kaiyan-sheng kaiyan-sheng deleted the s3_input branch February 26, 2020 18:34
@kaiyan-sheng kaiyan-sheng added v7.7.0 and removed needs_backport PR is waiting to be backported to other branches. labels Feb 26, 2020
kaiyan-sheng added a commit that referenced this pull request Feb 26, 2020
…-type (#16441) (#16627)

* Check expand_event_list_from_field before checking content-type

(cherry picked from commit 4bb8fa3)
kaiyan-sheng added a commit that referenced this pull request Feb 26, 2020
…-type (#16441) (#16626)

* Check expand_event_list_from_field before checking content-type

(cherry picked from commit 4bb8fa3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Filebeat Filebeat review Team:Platforms Label for the Integrations - Platforms team v7.6.1 v7.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Filebeat] S3 input issue for cloudtrail: createEventsFromS3Info failed
3 participants