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] return error when expand_event_list_from_field is missing #17121

Merged
merged 2 commits into from
Mar 23, 2020
Merged

[Filebeat] return error when expand_event_list_from_field is missing #17121

merged 2 commits into from
Mar 23, 2020

Conversation

kaiyan-sheng
Copy link
Contributor

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

What does this PR do?

This PR is to improve s3 input error when expand_event_list_from_field for application/json content-type files, such as cloudtrail logs.

Why is it important?

This problem only happens if user is trying to collect application/json content-type files such as cloudtrail logs, but not using cloudtrail fileset. It's good to add the error message there for user to see why log is not being processed by Filebeat.

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

How to test this PR locally

Collect cloudtrail logs first. Instead of using cloudtrail fileset, use s3 input directly with filebeat.yml config like:

filebeat.inputs:
- type: s3
  queue_url:   https://sqs.us-east-1.amazonaws.com/428152502467/test-fb-ks
  credential_profile_name: elastic-beats

This should return error when trying to read cloudtrail log:

2020-03-19T10:57:08.897-0600    ERROR   [s3]    s3/input.go:434 expand_event_list_from_field parameter is missing in config for application/json content-type file
2020-03-19T10:57:08.897-0600    ERROR   [s3]    s3/input.go:387 createEventsFromS3Info failed for AWSLogs/428152502467/CloudTrail/us-east-2/2019/12/19/428152502467_CloudTrail_us-east-2_20191219T1655Z_WXCas1PVnOaTpABD.json.gz: expand_event_list_from_field parameter is missing in config for application/json content-type file

Related issues

@kaiyan-sheng kaiyan-sheng self-assigned this Mar 19, 2020
@kaiyan-sheng kaiyan-sheng marked this pull request as ready for review March 19, 2020 18:04
@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 Mar 20, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-platforms (Team:Platforms)

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

Looks good.

@kaiyan-sheng kaiyan-sheng merged commit c65648a into elastic:master Mar 23, 2020
@kaiyan-sheng kaiyan-sheng deleted the s3_input_err branch March 23, 2020 13:58
@kaiyan-sheng kaiyan-sheng added v7.7.0 and removed needs_backport PR is waiting to be backported to other branches. labels Mar 23, 2020
kaiyan-sheng added a commit that referenced this pull request Mar 23, 2020
…17121) (#17182)

* return error when expand_event_list_from_field is missing with application/json file

(cherry picked from commit c65648a)
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.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