From 986b947e981ea78b202294d03f0d077f7ec20c83 Mon Sep 17 00:00:00 2001 From: linrunqi08 <90741255+linrunqi08@users.noreply.github.com> Date: Thu, 4 Jan 2024 20:25:08 +0800 Subject: [PATCH] Added a switch to control the loading of the processor_spl, which by default remains unloaded. (#1312) * add switch --- core/plugin/PluginRegistry.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/plugin/PluginRegistry.cpp b/core/plugin/PluginRegistry.cpp index c3cac9114a..ee1eb99a9f 100644 --- a/core/plugin/PluginRegistry.cpp +++ b/core/plugin/PluginRegistry.cpp @@ -47,6 +47,10 @@ #include "processor/ProcessorSplitRegexNative.h" #include "processor/ProcessorTagNative.h" #include "processor/ProcessorSPL.h" +#include "common/Flags.h" + + +DEFINE_FLAG_BOOL(enable_processor_spl, "", false); using namespace std; @@ -231,7 +235,9 @@ void PluginRegistry::LoadStaticPlugins() { RegisterProcessorCreator(new StaticProcessorCreator()); RegisterProcessorCreator(new StaticProcessorCreator()); RegisterProcessorCreator(new StaticProcessorCreator()); - RegisterProcessorCreator(new StaticProcessorCreator()); + if (BOOL_FLAG(enable_processor_spl)) { + RegisterProcessorCreator(new StaticProcessorCreator()); + } RegisterFlusherCreator(new StaticFlusherCreator()); }