diff --git a/package/etc/conf.d/local/config/log_paths/lp-example.conf.tmpl b/package/etc/conf.d/local/config/log_paths/lp-example.conf.tmpl index 708bc7c..918530b 100644 --- a/package/etc/conf.d/local/config/log_paths/lp-example.conf.tmpl +++ b/package/etc/conf.d/local/config/log_paths/lp-example.conf.tmpl @@ -83,6 +83,19 @@ log { destination(d_archive); {{- end}} +{{- /* Check environment variables for sending to a global list of alternate destinations */}} + +{{- if (print (getenv "SC4S_DEST_GLOBAL_ALTERNATES")) }} + {{ getenv "SC4S_DEST_GLOBAL_ALTERNATES" | regexp.ReplaceLiteral "^" "destination(" | regexp.ReplaceLiteral "[, ]+" ");\n destination(" }}); +{{- end }} + +{{- /* Check environment variables for sending to a list of alternate destinations only for this specific source */}} + +{{- if (print (getenv "SC4S_DEST_LOCAL_EXAMPLE_ALTERNATES")) }} + {{ getenv "SC4S_DEST_LOCAL_EXAMPLE_ALTERNATES" | regexp.ReplaceLiteral "^" "destination(" | regexp.ReplaceLiteral "[, ]+" ");\n destination(" }}); +{{- end }} + + # All passes through any matching log path will be final flags(flow-control,final); }; \ No newline at end of file diff --git a/package/etc/local_config/log_paths/lp-example.conf.tmpl b/package/etc/local_config/log_paths/lp-example.conf.tmpl index 708bc7c..d168cc9 100644 --- a/package/etc/local_config/log_paths/lp-example.conf.tmpl +++ b/package/etc/local_config/log_paths/lp-example.conf.tmpl @@ -83,6 +83,18 @@ log { destination(d_archive); {{- end}} +{{- /* Check environment variables for sending to a global list of alternate destinations */}} + +{{- if (print (getenv "SC4S_DEST_GLOBAL_ALTERNATES")) }} + {{ getenv "SC4S_DEST_GLOBAL_ALTERNATES" | regexp.ReplaceLiteral "^" "destination(" | regexp.ReplaceLiteral "[, ]+" ");\n destination(" }}); +{{- end }} + +{{- /* Check environment variables for sending to a list of alternate destinations only for this specific source */}} + +{{- if (print (getenv "SC4S_DEST_LOCAL_EXAMPLE_ALTERNATES")) }} + {{ getenv "SC4S_DEST_LOCAL_EXAMPLE_ALTERNATES" | regexp.ReplaceLiteral "^" "destination(" | regexp.ReplaceLiteral "[, ]+" ");\n destination(" }}); +{{- end }} + # All passes through any matching log path will be final flags(flow-control,final); }; \ No newline at end of file