Skip to content
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

Fix log content duplication in ParseJsonNativeProcessor #1296

Merged
merged 7 commits into from
Jan 2, 2024

Conversation

quzard
Copy link
Collaborator

@quzard quzard commented Dec 29, 2023

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 quzard added the bug Something isn't working label Dec 30, 2023
@quzard quzard added this to the v2.0 milestone Jan 2, 2024
@yyuuttaaoo yyuuttaaoo merged commit e82d44e into alibaba:main Jan 2, 2024
17 checks passed
@quzard quzard deleted the fix/source_key_overwrite branch February 28, 2024 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants