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 #15252 to 7.5: [Filebeat] Check content type when reading s3 files #15369

Merged
merged 2 commits into from
Jan 8, 2020
Merged

Cherry-pick #15252 to 7.5: [Filebeat] Check content type when reading s3 files #15369

merged 2 commits into from
Jan 8, 2020

Conversation

kaiyan-sheng
Copy link
Contributor

Cherry-pick of PR #15252 to 7.5 branch. Original message:

When file name has .gz suffix but with text/plain content type, newS3BucketReader function will fail when using s3 input in Filebeat. Instead of simply checking file name, check the actual content type from the response and then decide how to build the new reader.

How to test it:

Upload file to an S3 bucket and change the file metadata property to test this PR:
Screen Shot 2020-01-07 at 7 48 59 AM

Upload a test1.txt.gz file and change content type to text/plain, s3 input should still be able to read the file.

closes #15225

* Check resp.ContentType and filename
* Remove case "text/plain" to use default instead

(cherry picked from commit 034e719)
@kaiyan-sheng kaiyan-sheng merged commit aeaeeeb into elastic:7.5 Jan 8, 2020
@kaiyan-sheng kaiyan-sheng deleted the backport_15252_7.5 branch January 8, 2020 15:54
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…reading s3 files (elastic#15369)

* [Filebeat] Check content type when reading s3 files (elastic#15252)

* Check resp.ContentType and filename
* Remove case "text/plain" to use default instead

(cherry picked from commit 6692049)

* Fix changelog
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.

None yet

2 participants