Skip to content

Commit

Permalink
[fix] Ensure white space padding in the url is removed (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Faircloth authored and GitHub committed Jul 10, 2020
1 parent e27f863 commit 9bf5b2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/etc/go_templates/splunk_hec.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ define "SPLUNK_HEC" }}
destination d_hec{{ .var_id }} {
{{- $url := (getenv (print "SPLUNK_HEC" .var_id "_URL")) }}
{{- $url := (getenv (print "SPLUNK_HEC" .var_id "_URL") | strings.Trim " " ) }}
http(
url("{{- $url | strings.ReplaceAll "/services/collector" "" | strings.ReplaceAll "/event" "" | regexp.ReplaceLiteral "[, ]+" "/services/collector/event " }}/services/collector/event")
method("POST")
Expand All @@ -13,7 +13,7 @@ destination d_hec{{ .var_id }} {
user_agent("sc4s/1.0 (events)")
user("sc4s")
headers("{{- getenv (print "SC4S_DEST_SPLUNK_HEC" .var_id "_HEADERS") "Connection: close"}}")
password("{{- getenv (print "SPLUNK_HEC" .var_id "_TOKEN")}}")
password("{{- getenv (print "SPLUNK_HEC" .var_id "_TOKEN") | strings.Trim " " }}")
persist-name("splunk_hec{{ .var_id }}")
response-action(400 => drop, 404 => retry)

Expand Down

0 comments on commit 9bf5b2e

Please sign in to comment.