-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 content type when reading s3 files #15252
Conversation
jenkins, test this please |
For information, AWS Cloudtrail set the content type to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested it and it works fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship it!
jenkins, test this please |
ci failures are not related. |
This PR will be tested when testing #15370 |
…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
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:
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