diff --git a/package/etc/conf.d/destinations/splunk_hec_debug.conf b/package/etc/conf.d/destinations/splunk_hec_debug.conf.tmpl similarity index 58% rename from package/etc/conf.d/destinations/splunk_hec_debug.conf rename to package/etc/conf.d/destinations/splunk_hec_debug.conf.tmpl index 795757b..c7f32dd 100644 --- a/package/etc/conf.d/destinations/splunk_hec_debug.conf +++ b/package/etc/conf.d/destinations/splunk_hec_debug.conf.tmpl @@ -1,6 +1,6 @@ destination d_hec_debug { file("/opt/syslog-ng/var/archive/debug/${.splunk.sourcetype}/${HOST}/$YEAR-$MONTH-$DAY-message.log" - template("curl -k -u \"sc4s HEC debug:$(env SPLUNK_HEC_TOKEN)\" \"$(env SPLUNK_HEC_URL)\" -d '$(format-json + template("curl -k -u \"sc4s HEC debug:{{- getenv "SPLUNK_HEC_TOKEN"}}\" \"{{- getenv "SPLUNK_HEC_URL" | strings.ReplaceAll "/services/collector" "" | strings.ReplaceAll "/event" "" | regexp.ReplaceLiteral "[, ]+" "/services/collector/event " }}/services/collector/event\" -d '$(format-json time=$S_UNIXTIME.$S_MSEC host=${HOST} source=${.splunk.source}