From 474a81b8c60c1edb4065fc6c218353f0ced111b7 Mon Sep 17 00:00:00 2001 From: Mark Bonsack Date: Mon, 16 Mar 2020 18:29:59 -0700 Subject: [PATCH] Update `d_hec_debug` to use gomplate * Update `d_hec_debug` to use gomplate to pick up post-tempated URL string --- .../{splunk_hec_debug.conf => splunk_hec_debug.conf.tmpl} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename package/etc/conf.d/destinations/{splunk_hec_debug.conf => splunk_hec_debug.conf.tmpl} (58%) 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}