Fix JSON escaping in task details log metadata - #20802
Conversation
PR Reviewer Guide 🔍(Review updated until commit ecefdcf)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to ecefdcf Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 108b278
Suggestions up to commit 807e7ff
Suggestions up to commit e4efd0f
Suggestions up to commit 78306c1
|
Wrap OpenSearchMessageField values with %enc{...}{JSON} in the
OpenSearchJsonLayout pattern to ensure proper JSON escaping of field
values that may contain quotes or other special characters.
Signed-off-by: zheliu2 <770120041@qq.com>
78306c1 to
e4efd0f
Compare
|
Persistent review updated to latest commit e4efd0f |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #20802 +/- ##
============================================
- Coverage 73.33% 73.31% -0.03%
- Complexity 72306 72315 +9
============================================
Files 5796 5796
Lines 330263 330263
Branches 47663 47663
============================================
- Hits 242189 242122 -67
- Misses 68660 68761 +101
+ Partials 19414 19380 -34 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gaobinlong
left a comment
There was a problem hiding this comment.
Thanks, I think this PR needs a change log.
|
Persistent review updated to latest commit 807e7ff |
Signed-off-by: zheliu2 <770120041@qq.com>
807e7ff to
a5bbbfd
Compare
Signed-off-by: gaobinlong <gbinlong@amazon.com>
|
Persistent review updated to latest commit 108b278 |
|
❌ Gradle check result for 108b278: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: gaobinlong <gbinlong@amazon.com>
|
Persistent review updated to latest commit ecefdcf |
|
❌ Gradle check result for ecefdcf: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for ecefdcf: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❕ Gradle check result for ecefdcf: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
) * Fix JSON escaping in task details log metadata (opensearch-project#8528) Wrap OpenSearchMessageField values with %enc{...}{JSON} in the OpenSearchJsonLayout pattern to ensure proper JSON escaping of field values that may contain quotes or other special characters. Signed-off-by: zheliu2 <770120041@qq.com> * Add CHANGELOG entry for opensearch-project#20802 Signed-off-by: zheliu2 <770120041@qq.com> --------- Signed-off-by: zheliu2 <770120041@qq.com> Signed-off-by: gaobinlong <gbinlong@amazon.com> Co-authored-by: gaobinlong <gbinlong@amazon.com> Signed-off-by: Aparajita Pandey <aparajita31pandey@gmail.com>
) * Fix JSON escaping in task details log metadata (opensearch-project#8528) Wrap OpenSearchMessageField values with %enc{...}{JSON} in the OpenSearchJsonLayout pattern to ensure proper JSON escaping of field values that may contain quotes or other special characters. Signed-off-by: zheliu2 <770120041@qq.com> * Add CHANGELOG entry for opensearch-project#20802 Signed-off-by: zheliu2 <770120041@qq.com> --------- Signed-off-by: zheliu2 <770120041@qq.com> Signed-off-by: gaobinlong <gbinlong@amazon.com> Co-authored-by: gaobinlong <gbinlong@amazon.com>
Description
Fixes #8528
The task details JSON logs (
opensearch_task_detailslog.json) contain improperly escaped metadata field values. When the metadata contains JSON-like content (e.g., search source), the quotation marks within the value are not escaped, resulting in invalid JSON log events.Testing
Added unit test to verify proper JSON escaping of metadata values.
Issues Resolved
Fixes #8528
Check List