-
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
Add multiline support to awss3 input #25710
Add multiline support to awss3 input #25710
Conversation
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
5b1a550
to
356cb8c
Compare
This pull request is now in conflicts. Could you fix it? 🙏
|
💚 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.
Awesome 😄 . I took a very quick pass at it. Plan to look a little deeper and try it out tomorrow.
offset += int64(len(log)) | ||
event := createEvent(log, offset, info, objectHash, s3Ctx) | ||
event := createEvent(string(message.Content), offset, info, objectHash, s3Ctx) | ||
offset += int64(message.Bytes) | ||
err = c.forwardEvent(event) | ||
if err != nil { |
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.
Can you combine this into a one-liner, e.g. if err = c.forwardEvent(event); err != nil {
.
VisibilityTimeout time.Duration `config:"visibility_timeout"` | ||
AwsConfig awscommon.ConfigAWS `config:",inline"` | ||
MaxBytes int `config:"max_bytes" validate:"min=0,nonzero"` | ||
Multiline *multiline.Config `config:"multiline"` |
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.
Do you think these options should be available in the FileSelectorCfg
?
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.
Hmmmm we could...
The use case would be a single S3 bucket that has a mix of multiline and non-multiline log files.
I'll add it, and we can see if we like it.
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.
The parser options could be combined into a struct that is embedded in both config
and FileSelectorCfg
to avoid having to duplicate the same config struct tags.
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'm thinking of changing this so you always have a file_selector, the default is just to match any filename. That should make the config and code paths cleaner. I know we want to get a build out with multiline "soon". You OK with merging as is, with a new PR this week to clean this up?
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.
Do you think could be worth adding a new test with the multiline config in s3_integration_test.go
?
This pull request is now in conflicts. Could you fix it? 🙏
|
added it. running it is a little weird you have to setup S3 bucket & SQS ahead of time, then upload the 2 sample files, then run Long term I'd like to improve this. |
- only applies to non JSON logstash Closes elastic#25249
Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
52120e1
to
da10563
Compare
I think some files need to be formatted |
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 once the formatting is fixed
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! Thank you for adding this feature!! Are you planning to add this into the AWS package later? I'm adding the label just to make sure we don't forget about it :)
What does this PR do?
Adds multiline and encoding reader support to aws-s3 input. This does
not change the processing of JSON logs by aws-s3 input.
Why is it important?
This is needed so you can read logs that have embedded new lines. For
example XML Windows events.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
Related issues