Skip to content

Commit

Permalink
Update splunk_hec.conf.tmpl
Browse files Browse the repository at this point in the history
Added dir argument to disk buffer in splunk_hec_conf.tmpl

This change adds code to look for the SC4S_DEST_SPLUNK_HEC_DISKBUFF_DIR environmental variable and if present, it uses that directory for the directory of the disk buffer.

The dir() option allows you to change the directory used for disk buffers.  For 3.16 the feature is document at
https://www.syslog-ng.com/technical-documents/doc/syslog-ng-open-source-edition/3.16/administration-guide/disk-buffer

The caveat is if you have already encountered disk buffering, there will be a persist file in the previous location (default /var/lib/syslog-ng) and that persist file will prevent syslog-ng from sucessfully using the new location.
  • Loading branch information
William E. T. III authored and GitHub committed Apr 6, 2020
1 parent 7568570 commit 41fab07
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions package/etc/conf.d/destinations/splunk_hec.conf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ destination d_hec {
mem-buf-length({{conv.ToInt64 (math.Round ( math.Div (getenv "SC4S_DEST_SPLUNK_HEC_DISKBUFF_MEMBUFLENGTH" "15000") (getenv "SC4S_DEST_SPLUNK_HEC_WORKERS" "10")))}})
reliable(no)
{{- end}}
{{- if ne (getenv "SC4S_DEST_SPLUNK_HEC_DISKBUFF_DIR") ""}}
dir("{{- getenv "SC4S_DEST_SPLUNK_HEC_DISKBUFF_DIR"}}")
{{- end}}
disk-buf-size({{conv.ToInt64 (math.Round ( math.Div (getenv "SC4S_DEST_SPLUNK_HEC_DISKBUFF_DISKBUFSIZE" "53687091200") (getenv "SC4S_DEST_SPLUNK_HEC_WORKERS" "10")))}})
)
{{- end}}
Expand Down

0 comments on commit 41fab07

Please sign in to comment.