From 1519927278ea5a5eedd6cb280be0946bfc8ab9e4 Mon Sep 17 00:00:00 2001 From: Mark Bonsack Date: Fri, 13 Mar 2020 14:40:04 -0700 Subject: [PATCH] Update internal log path for alt dest * Update metrics portion of internal log path to check the alternate destination env vars for alternate destinations --- .../etc/conf.d/log_paths/lp-sc4s_internal.conf.tmpl | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 9dc43ae..31af53d 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,6 +20,18 @@ log { destination(d_hecmetrics); {{- end}} + {{- if eq (getenv "SC4S_DEBUG_STDOUT" "yes") "yes"}} + destination(d_stdout); + {{- end}} + + {{- if (print (getenv "SC4S_DEST_GLOBAL_ALTERNATES")) }} + {{ getenv "SC4S_DEST_GLOBAL_ALTERNATES" | regexp.ReplaceLiteral "^" "destination(" | regexp.ReplaceLiteral "[, ]+" ");\n destination(" }}); + {{- end }} + + {{- if (print (getenv "SC4S_DEST_INTERNAL_EVENTS_ALTERNATES")) }} + {{ getenv "SC4S_DEST_INTERNAL_EVENTS_ALTERNATES" | regexp.ReplaceLiteral "^" "destination(" | regexp.ReplaceLiteral "[, ]+" ");\n destination(" }}); + {{- end }} + } else { rewrite { r_set_splunk_dest_default(sourcetype("sc4s:events"), index("main"))};