Skip to content

Commit

Permalink
Merge pull request #361 from splunk/fix/debug_default
Browse files Browse the repository at this point in the history
Fix incorrect default for `SC4S_DEBUG_STDOUT`
  • Loading branch information
Ryan Faircloth authored and GitHub committed Mar 14, 2020
2 parents 45a8dcc + 9978467 commit ddab7c5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package/etc/conf.d/log_paths/lp-sc4s_internal.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

Expand All @@ -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}}

Expand Down
21 changes: 15 additions & 6 deletions package/etc/conf.d/log_paths/lp-sc4s_startup.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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}}

Expand Down

0 comments on commit ddab7c5

Please sign in to comment.