-
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
[Enhancement] extract the correct body if s3 notify via SNS->SQS #25492
[Enhancement] extract the correct body if s3 notify via SNS->SQS #25492
Conversation
💔 Build Failed
Expand to view the summary
Build stats
Trends 🧪Steps errorsExpand to view the steps failures
|
Pinging @elastic/integrations (Team:Integrations) |
test(x-pack/filebeat): add unit test for s3-sns-sqs
Now we´ve added the tests. Ready for review. Sorry for the delay. |
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.
Thank you for working on this. Could you add a changelog entry for this fix please?
Added a simple line to the changelog. Any other documentation needed? |
Anything, I could do here? @kaiyan-sheng |
} | ||
if err := json.Unmarshal([]byte(*m.Body), &bodyJSON); err == nil && bodyJSON.TopicArn != "" { | ||
err := json.Unmarshal([]byte(bodyJSON.Message), &msg) | ||
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.
Seems like these two error checks have duplicate code, could you simplify this part please?
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.
Deduplicated this. You are right...
@christianherweg0807 Sorry for the delay on this!! Thank you for your contribution. With this change, does that mean users can setup S3 bucket to create and subscribe to an SNS topic? |
Thank you @christianherweg0807 so much for the information! I think this is a great addition to s3 input, maybe we should also add more in the documentation? |
This pull request is now in conflicts. Could you fix it? 🙏
|
/test |
seems like CI is not happy, maybe you need |
Sorry, i missed a variable scope... |
/test |
@christianherweg0807 Hmm seems like CI is not happy with go.sum?
|
This pull request is now in conflicts. Could you fix it? 🙏
|
@christianherweg0807 Hi sorry you have to deal with the conflict because there were two big prs got merged for s3 input. |
Love the work, Any traction on this PR by chance? For me it seems like converting msg to |
@christianherweg0807 Thank you so much for your initiative on this!! I'm closing this PR and will use #28800 to continue to work. |
What does this PR do?
This PR parses the SQS Message Body and tries to match to a SNS Message Structure. If BodyJSON.TopicArn is not empty, it delivers the bodyJSON.Message as body instead of m.Body.
Use cases
Configless detections of S3 notifications delivered via SNS to a SQS Queue.