[AWS][Lambda] Fix AWS Lambda data stream aws.lambda.message handling#19250
Conversation
a32f83b to
0277758
Compare
0277758 to
d4d3bb8
Compare
Elastic Docs Style Checker (Vale)Summary: 1 suggestion found 💡 Suggestions (1): Optional style improvements. Apply when helpful.
The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
d4d3bb8 to
53df15e
Compare
🚀 Benchmarks reportPackage
|
| Data stream | Previous EPS | New EPS | Diff (%) | Result |
|---|---|---|---|---|
rds |
41666.67 | 32258.06 | -9408.61 (-22.58%) | 💔 |
route53_public_logs |
23809.52 | 8695.65 | -15113.87 (-63.48%) | 💔 |
s3access |
5291.01 | 2932.55 | -2358.46 (-44.57%) | 💔 |
vpcflow |
8264.46 | 4504.5 | -3759.96 (-45.5%) | 💔 |
ec2_logs |
47619.05 | 38461.54 | -9157.51 (-19.23%) | 💔 |
To see the full report comment with /test benchmark fullreport
|
@Kavindu-Dodan, is this PR a duplicate of #17398? cc @gpop63 |
53df15e to
cffb4fe
Compare
Additional Root Cause:
|
|
@markjandejong really appreciate the detailed explanation and the solution for the issue. IMO this deserves a dedicated PR with a focused tests given this specific PR focuses on Lambda fix. Happy to review once it's open. |
@Kavindu-Dodan A new PR will be a duplicate of this issue as they both address the exact same problem with regards to Lambda log ingestion of JSON payloads. I figure I would provide input of my findings in hopes to come to a unified resolution. |
Thanks for insisting on this issue. I added the change you proposed through commit 67466a3 |
| target_field: "@timestamp" | ||
| formats: ["yyyy-MM-dd HH:mm:ss,SSSZ"] | ||
| ignore_failure: true | ||
|
|
There was a problem hiding this comment.
parsed.timestamp should be removed after extraction here.
- remove:
field: parsed.timestamp
ignore_missing: true
ignore_failure: trueThere was a problem hiding this comment.
No I do not think we should remove this. aws.lambda.message is expected to preserve the original message. See here - https://github.com/elastic/integrations/pull/19250/changes#diff-47c5bd851c7038676fd767648faf7ee6b269124328340a869ba2326cf56187e6R59-R63
|
@MichaelKatsoulis @kcreddy @markjandejong can I get another round of review 🙏 |
kcreddy
left a comment
There was a problem hiding this comment.
The duplication (root message + aws.lambda.message.message) won't cause indexing failures. It's a storage/clarity trade-off, not a correctness issue.
The core issue for the string-into-flattened-field bug should be fixed by this PR. Deferring to @elastic/obs-infraobs-integrations as the integration owners to make the final call.
|
Hey @Kavindu-Dodan , while testing this I noticed
Could we add the same fallback to the plaintext pipeline? I believe it is worth adding it in this PR |
Thanks @MichaelKatsoulis . Yes I think we can add this too See 7c0f33c, this is done :) If no further remarks by end of the day, I will merge this PR. |
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> # Conflicts: # packages/aws/changelog.yml # Conflicts: # packages/aws/changelog.yml # packages/aws/manifest.yml
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
7c0f33c to
150b526
Compare
|
@agithomas could you please have a final look 🙏 |
💚 Build Succeeded
History
|
|
Package aws - 6.19.1 containing this change is available at https://epr.elastic.co/package/aws/6.19.1/ |
Proposed commit message
aws.lambda.messageis defined as aflattenedfield. However, Lambda integration's JSON pipeline ignore checks to validate this. This causes JSON pipeline to parse but Elastic indexing to fail withexpecting token of type [START_OBJECT] but found [VALUE_STRING]See
fields.yamlof this integration for specific field definition (see extraction below),If the payload contains a non-compliant content, then this fix preserve the original message at root level
messagefield.See test changes and newly added tests to understand the change better.
Additionally,
messagesection is now added in plain text mode as well.Checklist
changelog.ymlfile.