Skip to content

Commit

Permalink
Added default check for TLS; remove extraneos ToBool declarations
Browse files Browse the repository at this point in the history
* Add check for TLS enable env var in default source
* Remove extraneous `conv.ToBool` declarations
  • Loading branch information
Mark Bonsack committed Jan 8, 2020
1 parent 230e282 commit db9219f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ log {
#2012/04/10 04:39:55
#parse the date
date-parser(
{{- if ((getenv "SC4S_SOURCE_FF_PALOALTO_PANOS_TIME_MS") | conv.ToBool) }}
{{- if (conv.ToBool (getenv "SC4S_SOURCE_FF_PALOALTO_PANOS_TIME_MS")) }}
format("%Y/%m/%d %H:%M:%S.%f")
{{- else}}
format("%Y/%m/%d %H:%M:%S")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Symantec Brightmail

{{- if ((getenv "SC4S_SOURCE_FF_SYMANTEC_BRIGHTMAIL_GROUPMSG" "yes") | conv.ToBool) }}
{{- if (conv.ToBool (getenv "SC4S_SOURCE_FF_SYMANTEC_BRIGHTMAIL_GROUPMSG" "yes")) }}
filter f_symantec_brightmail_complete{
match("yes", value("SMG.COMPLETE") type(glob));
};
Expand Down Expand Up @@ -39,7 +39,7 @@ log {
source (s_SYMANTEC_BRIGHTMAIL);
{{- end }}

{{- if ((getenv "SC4S_SOURCE_FF_SYMANTEC_BRIGHTMAIL_GROUPMSG" "yes") | conv.ToBool) }}
{{- if (conv.ToBool (getenv "SC4S_SOURCE_FF_SYMANTEC_BRIGHTMAIL_GROUPMSG" "yes")) }}
if {

filter(f_symantec_brightmail_details);
Expand Down Expand Up @@ -83,7 +83,7 @@ log {
{{- if or (conv.ToBool (getenv "SC4S_ARCHIVE_GLOBAL" "no")) (conv.ToBool (getenv "SC4S_ARCHIVE_SYMANTEC_BRIGHTMAIL" "no")) }}
destination(d_archive);
{{- end}}
{{- if ((getenv "SC4S_SOURCE_FF_SYMANTEC_BRIGHTMAIL_GROUPMSG" "yes") | conv.ToBool) }}
{{- if (conv.ToBool (getenv "SC4S_SOURCE_FF_SYMANTEC_BRIGHTMAIL_GROUPMSG" "yes")) }}
};
{{- end}}

Expand Down
2 changes: 1 addition & 1 deletion package/etc/conf.d/log_paths/startup.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ log {
rewrite { r_set_splunk_dest_default(sourcetype("sc4s:events"), index("main"))};
parser {p_add_context_splunk(key("sc4s_events:startup:out")); };

{{- if or (conv.ToBool (getenv "SC4S_DEST_SPLUNK_HEC_GLOBAL" "yes")) (conv.ToBool (getenv "SC4S_DEST_INTERNAL_EVENTS_HEC" "no") | conv.ToBool) }}
{{- 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}}

Expand Down
2 changes: 1 addition & 1 deletion package/etc/go_templates/source_network.t
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ source s_{{ .port_id }} {
flags(no-parse)
);
{{- end}}
{{- if or (getenv (print "SC4S_LISTEN_" .port_id "_TLS_PORT")) (eq .port_id "DEFAULT_TLS") }}
{{- if (conv.ToBool (getenv "SC4S_SOURCE_TLS_ENABLE" "no")) }}
network(
transport("tls")
port({{ getenv (print "SC4S_LISTEN_" .port_id "_TLS_PORT") "6514" }})
Expand Down

0 comments on commit db9219f

Please sign in to comment.