Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[backport]Fix log content duplication in ParseJsonNativeProcessor #1295

Merged
merged 1 commit into from
Dec 29, 2023

Conversation

yyuuttaaoo
Copy link
Collaborator

This commit resolves an issue in ParseJsonNativeProcessor where the original log content was unintentionally retained in the "content" field due to improper state management.

The processor incorrectly maintained a class-level state indicating whether the "content" key was overwritten during JSON parsing. While this state should be reset for each new log, it was persistently kept across logs. Consequently, if a JSON log contained a "content" key, the processor would mark the state as overwritten and not drop the "content" field in subsequent logs, leading to duplicated content.

To address this, the state tracking the "content" key overwrite is moved from class level to local level, ensuring it is reset at the start of each log parsing operation.

This commit resolves an issue in ParseJsonNativeProcessor
where the original log content was unintentionally retained in the
"content" field due to improper state management.

The processor incorrectly maintained a class-level state indicating
whether the "content" key was overwritten during JSON parsing. While
this state should be reset for each new log, it was persistently kept
across logs. Consequently, if a JSON log contained a "content" key, the
processor would mark the state as overwritten and not drop the "content"
field in subsequent logs, leading to duplicated content.

To address this, the state tracking the "content" key overwrite is
moved from class level to local level, ensuring it is reset at the start of each log parsing operation.
@quzard
Copy link
Collaborator

quzard commented Dec 29, 2023

[backport]

@yyuuttaaoo yyuuttaaoo changed the title Fix log content duplication in ParseJsonNativeProcessor [backport]Fix log content duplication in ParseJsonNativeProcessor Dec 29, 2023
@yyuuttaaoo yyuuttaaoo merged commit 534d7f8 into 1.8 Dec 29, 2023
17 checks passed
@yyuuttaaoo yyuuttaaoo added this to the v1.8 milestone Dec 29, 2023
@yyuuttaaoo yyuuttaaoo added the bug Something isn't working label Dec 29, 2023
@henryzhx8 henryzhx8 deleted the fix/source_key_overwrite branch June 21, 2024 08:47
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants