From 9978467040e2a513a79e994126ad7c9287fda528 Mon Sep 17 00:00:00 2001 From: Mark Bonsack Date: Fri, 13 Mar 2020 16:51:25 -0700 Subject: [PATCH] Fix incorrect default for `SC4S_DEBUG_STDOUT` * Fix incorect default for `SC4S_DEBUG_STDOUT` --- .../log_paths/lp-sc4s_internal.conf.tmpl | 4 ++-- .../log_paths/lp-sc4s_startup.conf.tmpl | 21 +++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/package/etc/conf.d/log_paths/lp-sc4s_internal.conf.tmpl b/package/etc/conf.d/log_paths/lp-sc4s_internal.conf.tmpl index 31af53d..fafde80 100644 --- a/package/etc/conf.d/log_paths/lp-sc4s_internal.conf.tmpl +++ b/package/etc/conf.d/log_paths/lp-sc4s_internal.conf.tmpl @@ -20,7 +20,7 @@ log { destination(d_hecmetrics); {{- end}} - {{- if eq (getenv "SC4S_DEBUG_STDOUT" "yes") "yes"}} + {{- if eq (getenv "SC4S_DEBUG_STDOUT" "yes") "no"}} destination(d_stdout); {{- end}} @@ -41,7 +41,7 @@ log { destination(d_hec_internal); {{- end}} - {{- if eq (getenv "SC4S_DEBUG_STDOUT" "yes") "yes"}} + {{- if eq (getenv "SC4S_DEBUG_STDOUT" "yes") "no"}} destination(d_stdout); {{- end}} diff --git a/package/etc/conf.d/log_paths/lp-sc4s_startup.conf.tmpl b/package/etc/conf.d/log_paths/lp-sc4s_startup.conf.tmpl index 6b1d7e9..d72fd52 100644 --- a/package/etc/conf.d/log_paths/lp-sc4s_startup.conf.tmpl +++ b/package/etc/conf.d/log_paths/lp-sc4s_startup.conf.tmpl @@ -6,16 +6,25 @@ log { rewrite { r_set_splunk_dest_default(sourcetype("sc4s:events:startup:out"), index("main"))}; parser {p_add_context_splunk(key("sc4s_events")); }; - {{- if or (conv.ToBool (getenv "SC4S_DEST_SPLUNK_HEC_GLOBAL" "yes")) (conv.ToBool (getenv "SC4S_DEST_INTERNAL_EVENTS_HEC" "no")) }} +{{- if or (conv.ToBool (getenv "SC4S_DEST_SPLUNK_HEC_GLOBAL" "yes")) (conv.ToBool (getenv "SC4S_DEST_INTERNAL_EVENTS_HEC" "no")) }} destination(d_hec_internal); - {{- end}} +{{- end}} - {{- if eq (getenv "SC4S_DEBUG_STDOUT" "yes") "yes"}} +{{- if eq (getenv "SC4S_DEBUG_STDOUT" "yes") "no"}} destination(d_stdout); - {{- end}} +{{- end}} + +{{- if (print (getenv "SC4S_DEST_GLOBAL_ALTERNATES")) }} + {{ getenv "SC4S_DEST_GLOBAL_ALTERNATES" | regexp.ReplaceLiteral "^" "destination(" | regexp.ReplaceLiteral "[, ]+" ");\n destination(" }}); +{{- end }} - flags(flow-control,final); +{{- if (print (getenv "SC4S_DEST_INTERNAL_EVENTS_ALTERNATES")) }} + {{ getenv "SC4S_DEST_INTERNAL_EVENTS_ALTERNATES" | regexp.ReplaceLiteral "^" "destination(" | regexp.ReplaceLiteral "[, ]+" ");\n destination(" }}); +{{- end }} + + flags(flow-control,final); }; + log { source(s_startup_err); @@ -26,7 +35,7 @@ log { destination(d_hec_internal); {{- end}} -{{- if eq (getenv "SC4S_DEBUG_STDOUT" "yes") "yes"}} +{{- if eq (getenv "SC4S_DEBUG_STDOUT" "yes") "no"}} destination(d_stdout); {{- end}}