From 45727f5b28a82a1bda914f567b55ad59fd54fe5c Mon Sep 17 00:00:00 2001 From: quzard <1191890118@qq.com> Date: Tue, 2 Jan 2024 02:22:25 +0000 Subject: [PATCH] fix --- core/processor/ProcessorParseApsaraNative.cpp | 6 +++--- core/processor/ProcessorParseApsaraNative.h | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/processor/ProcessorParseApsaraNative.cpp b/core/processor/ProcessorParseApsaraNative.cpp index 4e49d9010a..bb6356fca8 100644 --- a/core/processor/ProcessorParseApsaraNative.cpp +++ b/core/processor/ProcessorParseApsaraNative.cpp @@ -125,7 +125,7 @@ bool ProcessorParseApsaraNative::ProcessEvent(const StringView& logPath, if (!sourceEvent.HasContent(mSourceKey)) { return true; } - mSourceKeyOverwritten = false; + bool sourceKeyOverwritten = false; StringView buffer = sourceEvent.GetContent(mSourceKey); if (buffer.size() == 0) { return true; @@ -210,7 +210,7 @@ bool ProcessorParseApsaraNative::ProcessEvent(const StringView& logPath, StringView data(buffer.data() + colon_index + 1, index - colon_index - 1); AddLog(key, data, sourceEvent); if (key == mSourceKey) { - mSourceKeyOverwritten = true; + sourceKeyOverwritten = true; } colon_index = -1; } @@ -228,7 +228,7 @@ bool ProcessorParseApsaraNative::ProcessEvent(const StringView& logPath, sb.size = std::min(20, snprintf(sb.data, sb.capacity, "%lld", logTime_in_micro)); #endif AddLog("microtime", StringView(sb.data, sb.size), sourceEvent); - if (!mSourceKeyOverwritten) { + if (!sourceKeyOverwritten) { sourceEvent.DelContent(mSourceKey); } if (mCommonParserOptions.ShouldAddSourceContent(true)) { diff --git a/core/processor/ProcessorParseApsaraNative.h b/core/processor/ProcessorParseApsaraNative.h index 158ef480da..bfc96cc6aa 100644 --- a/core/processor/ProcessorParseApsaraNative.h +++ b/core/processor/ProcessorParseApsaraNative.h @@ -50,7 +50,6 @@ class ProcessorParseApsaraNative : public Processor { int32_t ParseApsaraBaseFields(const StringView& buffer, LogEvent& sourceEvent); int32_t mLogTimeZoneOffsetSecond = 0; - bool mSourceKeyOverwritten = false; int* mLogGroupSize = nullptr; int* mParseFailures = nullptr;