Skip to content

Commit

Permalink
Update example log path to inclucde alt destination
Browse files Browse the repository at this point in the history
* Update `lp-example.conf.tmpl` to include env variable support for alternate destinations
  • Loading branch information
Mark Bonsack committed Mar 23, 2020
1 parent ddab7c5 commit dd019cb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
13 changes: 13 additions & 0 deletions package/etc/conf.d/local/config/log_paths/lp-example.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
12 changes: 12 additions & 0 deletions package/etc/local_config/log_paths/lp-example.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

0 comments on commit dd019cb

Please sign in to comment.