-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace confgen with the use of a entry point step which will convert tmpl files to conf files and replace the use of "blocks" with generated named config section to improve metrics
- Loading branch information
Ryan Faircloth
authored and
GitHub
committed
Sep 25, 2019
1 parent
3def0e0
commit 6079206
Showing
55 changed files
with
474 additions
and
654 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,93 +0,0 @@ | ||
| # =============================================================================================== | ||
| # source definition for remote devices | ||
| # =============================================================================================== | ||
|
|
||
| # =============================================================================================== | ||
| # Defaults for the default-network-drivers() source: | ||
| # 514, both TCP and UDP, for RFC3164 (BSD-syslog) formatted traffic | ||
| # 601 TCP, for RFC5424 (IETF-syslog) formatted traffic | ||
| # 6514 TCP, for TLS-encrypted traffic | ||
| # =============================================================================================== | ||
|
|
||
| channel { | ||
| source { | ||
| {{ if ne (getenv "confgen_udp_port") "no" }} | ||
| syslog ( | ||
| transport("udp") | ||
| port({{getenv "confgen_udp_port"}}) | ||
| ip-protocol(4) | ||
| so-rcvbuf({{getenv "SC4S_SOURCE_UDP_SO_RCVBUFF" "425984"}}) | ||
| keep-hostname(yes) | ||
| keep-timestamp(yes) | ||
| use-dns(no) | ||
| use-fqdn(no) | ||
| chain-hostnames(off) | ||
| flags(no-parse) | ||
| ); | ||
| {{ end }} | ||
| {{ if ne (getenv "confgen_tcp_port") "no" }} | ||
| network ( | ||
| transport("tcp") | ||
| port({{getenv "confgen_tcp_port"}}) | ||
| ip-protocol(4) | ||
| max-connections({{getenv "SC4S_SOURCE_TCP_MAX_CONNECTIONS" "2000"}}) | ||
| log-iw-size({{getenv "SC4S_SOURCE_TCP_IW_SIZE" "20000000"}}) | ||
| log-fetch-limit({{getenv "SC4S_SOURCE_TCP_FETCH_LIMIT" "2000"}}) | ||
| keep-hostname(yes) | ||
| keep-timestamp(yes) | ||
| use-dns(no) | ||
| use-fqdn(no) | ||
| chain-hostnames(off) | ||
| flags(no-parse) | ||
| ); | ||
| {{ end }} | ||
| }; | ||
| #TODO: #60 Remove this function with enhancement | ||
| rewrite(set_rfcnonconformant); | ||
|
|
||
| {{ if eq (getenv "confgen_parser") "rfc5424_strict" }} | ||
| filter(f_rfc5424_strict); | ||
| parser { | ||
| syslog-parser(flags(syslog-protocol store-raw-message)); | ||
| }; | ||
| rewrite(set_rfc5424_strict); | ||
| {{ else if eq (getenv "confgen_parser") "rfc5424_noversion" }} | ||
| filter(f_rfc5424_noversion); | ||
| parser { | ||
| syslog-parser(flags(syslog-protocol store-raw-message)); | ||
| }; | ||
| rewrite(set_rfc5424_noversion); | ||
| {{ else if eq (getenv "confgen_parser") "cisco_parser" }} | ||
| parser {cisco-parser()}; | ||
| rewrite(set_metadata_vendor_product_cisco_ios); | ||
| {{ else if eq (getenv "confgen_parser") "rfc3164" }} | ||
| parser { | ||
| syslog-parser(time-zone({{getenv "SC4S_DEFAULT_TIMEZONE" "GMT"}}) flags(store-raw-message)); | ||
| }; | ||
| rewrite(set_rfc3164); | ||
| {{ else }} | ||
| if { | ||
| filter(f_rfc5424_strict); | ||
| parser { | ||
| syslog-parser(flags(syslog-protocol store-raw-message)); | ||
| }; | ||
| rewrite(set_rfc5424_strict); | ||
| } elif { | ||
| filter(f_rfc5424_noversion); | ||
| parser { | ||
| syslog-parser(flags(syslog-protocol store-raw-message)); | ||
| }; | ||
| rewrite(set_rfc5424_noversion); | ||
| } elif { | ||
| parser {cisco-parser()}; | ||
| rewrite(set_metadata_vendor_product_cisco_ios); | ||
| } else { | ||
| parser { | ||
| syslog-parser(time-zone({{getenv "SC4S_DEFAULT_TIMEZONE" "GMT"}}) flags(store-raw-message)); | ||
| }; | ||
| rewrite(set_rfc3164); | ||
| }; | ||
| {{ end }} | ||
| rewrite(r_set_splunk_default); | ||
|
|
||
| }; | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
21 changes: 13 additions & 8 deletions
21
package/etc/conf.d/destinations/splunk_hec_metrics.conf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,25 @@ | ||
| destination d_hecmetrics { | ||
| http( | ||
| url("{{getenv "SPLUNK_HEC_URL"}}") | ||
| url("{{- getenv "SPLUNK_HEC_URL"}}") | ||
| method("POST") | ||
| batch-lines(50) | ||
| batch-bytes(1024Kb) | ||
| batch-timeout(1) | ||
| timeout(15) | ||
| user_agent("sc4s/1.0 (internal metrics)") | ||
| user("sc4s") | ||
| headers("{{getenv "SC4S_DEST_SPLUNK_HEC_HEADERS" "Connection: close"}}") | ||
| password("{{getenv "SPLUNK_HEC_TOKEN"}}") | ||
| headers("{{- getenv "SC4S_DEST_SPLUNK_HEC_HEADERS" "Connection: close"}}") | ||
| password("{{- getenv "SPLUNK_HEC_TOKEN"}}") | ||
| persist-name("splunk_metrics") | ||
|
|
||
| tls(peer-verify({{getenv "SC4S_DEST_SPLUNK_HEC_TLS_VERIFY" "yes"}}) | ||
| {{if ne (getenv "SC4S_DEST_SPLUNK_HEC_CIPHER_SUITE") ""}} cipher-suite("{{getenv "SC4S_DEST_SPLUNK_HEC_CIPHER_SUITE"}}"){{end}} | ||
| {{if ne (getenv "SC4S_DEST_SPLUNK_HEC_SSL_VERSION") ""}} ssl-version("{{getenv "SC4S_DEST_SPLUNK_HEC_SSL_VERSION"}}"){{end}} | ||
| ca-file("{{getenv "SC4S_DEST_SPLUNK_HEC_TLS_CA_FILE" "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem"}}") | ||
| ) | ||
| tls(peer-verify({{- getenv "SC4S_DEST_SPLUNK_HEC_TLS_VERIFY" "yes"}}) | ||
| {{- if ne (getenv "SC4S_DEST_SPLUNK_HEC_CIPHER_SUITE") ""}} | ||
| cipher-suite("{{- getenv "SC4S_DEST_SPLUNK_HEC_CIPHER_SUITE"}}") | ||
| {{- end}} | ||
| {{- if ne (getenv "SC4S_DEST_SPLUNK_HEC_SSL_VERSION") ""}} | ||
| ssl-version("{{- getenv "SC4S_DEST_SPLUNK_HEC_SSL_VERSION"}}") | ||
| {{- end}} | ||
| ca-file("{{- getenv "SC4S_DEST_SPLUNK_HEC_TLS_CA_FILE" "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem"}}")) | ||
| body('$MESSAGE') | ||
| ); | ||
| }; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| file("/dev/stdout"); | ||
| destination d_stdout { | ||
| file("/dev/stdout"); | ||
| }; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.