Skip to content

Commit

Permalink
Merge pull request #367 from splunk/log_path/example
Browse files Browse the repository at this point in the history
Update example log path to inclucde alt destination
  • Loading branch information
Ryan Faircloth authored and GitHub committed Mar 24, 2020
2 parents cf98cc6 + dd019cb commit dab8f2e
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 dab8f2e

Please sign in to comment.