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

Cherry-pick #17121 to 7.x: [Filebeat] return error when expand_event_list_from_field is missing #17182

Merged
merged 1 commit into from
Mar 23, 2020
Merged

Cherry-pick #17121 to 7.x: [Filebeat] return error when expand_event_list_from_field is missing #17182

merged 1 commit into from
Mar 23, 2020

Conversation

kaiyan-sheng
Copy link
Contributor

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

Cherry-pick of PR #17121 to 7.x branch. Original message:

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

…17121)

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

(cherry picked from commit c65648a)
@kaiyan-sheng kaiyan-sheng self-assigned this Mar 23, 2020
@kaiyan-sheng kaiyan-sheng added the Team:Platforms Label for the Integrations - Platforms team label Mar 23, 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 774731c into elastic:7.x Mar 23, 2020
@kaiyan-sheng kaiyan-sheng deleted the backport_17121_7.x branch March 23, 2020 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport review Team:Platforms Label for the Integrations - Platforms team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants