-
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
aws-s3 input default content-type #25772
aws-s3 input default content-type #25772
Conversation
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
- new option `content_type` - can be set at input or file selector level - overrides Content-Type that was given to the S3 object when it was uploaded. Closes elastic#25697
a286ff5
to
87f4f26
Compare
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
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.
Looks good to me.
Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
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.
LGTM.
@@ -82,6 +83,9 @@ func (f *readerConfig) Validate() error { | |||
if f.MaxBytes <= 0 { | |||
return fmt.Errorf("max_bytes <%v> must be greater than 0", f.MaxBytes) | |||
} | |||
if f.ExpandEventListFromField != "" && f.ContentType != "" && f.ContentType != "application/json" { | |||
return fmt.Errorf("content_type must be `application/json` to be used with expand_event_list_from_field") |
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.
return fmt.Errorf("content_type must be `application/json` to be used with expand_event_list_from_field") | |
return fmt.Errorf("content_type must be `application/json` when expand_event_list_from_field is used") |
Just a suggestion
* aws-s3 input default content-type - new option `content_type` - can be set at input or file selector level - overrides Content-Type that was given to the S3 object when it was uploaded. Closes #25697 Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co> (cherry picked from commit d62b1be) Co-authored-by: Lee Hinman <57081003+leehinman@users.noreply.github.com>
What does this PR do?
Adds a new option
content_type
to the aws-s3 input. This allows youto override the Content-Type that was given to the S3 object when it
was uploaded.
Why is it important?
Content-Type is used to determine if the S3 object should be treated
as JSON or not. If the object was uploaded with the incorrect
Content-Type that can prevent us from parsing the file correctly.
Checklist
- [ ] I have commented my code, particularly in hard-to-understand areas- [ ] I have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
Setup SQS and S3 bucket and download files.
Related issues