Skip to content

Commit

Permalink
Add d_hec_debug destination
Browse files Browse the repository at this point in the history
* Add `d_hec_debug` destination to output "curl" commands that can be directly run to debug HEC/token issues
  • Loading branch information
Mark Bonsack committed Mar 13, 2020
1 parent 82d4748 commit 35d66a9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions package/etc/conf.d/destinations/splunk_hec_debug.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
destination d_hec_debug {
file("/opt/syslog-ng/var/archive/${.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
time=$S_UNIXTIME.$S_MSEC
host=${HOST}
source=${.splunk.source}
sourcetype=${.splunk.sourcetype}
index=${.splunk.index}
event=$MSG
fields.*)'\n")
# file("/var/log/messages_syslog"
create_dirs(yes)
);
};

0 comments on commit 35d66a9

Please sign in to comment.