-
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.
Merge pull request #429 from splunk/feature/rfc5687
Alpha Support for this RFC5687
- Loading branch information
Showing
4 changed files
with
65 additions
and
0 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,7 @@ template t_JSON_5424 { | |
| --exclude DATE | ||
| --exclude FACILITY | ||
| --exclude PRIORITY | ||
| --exclude HOST | ||
| )'); | ||
| }; | ||
|
|
||
|
|
||
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 |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # IETF Syslog | ||
|
|
||
| log { | ||
| junction { | ||
| channel { | ||
| # Listen on the default port (typically 601) for IETF_SYSLOG traffic | ||
| source (s_ietf); | ||
| flags(final); | ||
| }; | ||
| }; | ||
|
|
||
| rewrite { | ||
| set("IETF_SYSLOG", value("fields.sc4s_vendor_product")); | ||
| }; | ||
|
|
||
| rewrite { r_set_splunk_dest_default(sourcetype("ietf:syslog"), index("main"), source("${APP}:${PROGRAM}")) }; | ||
| parser { p_add_context_splunk(key("IETF_SYSLOG")); }; | ||
| parser (compliance_meta_by_source); | ||
| rewrite { set("$(template ${.splunk.sc4s_template} $(template t_JSON_5424))" value("MSG")); }; | ||
|
|
||
| {{- if or (conv.ToBool (getenv "SC4S_DEST_SPLUNK_HEC_GLOBAL" "yes")) (conv.ToBool (getenv "SC4S_DEST_IETF_SYSLOG_HEC" "no")) }} | ||
| destination(d_hec); | ||
| {{- end}} | ||
|
|
||
| {{- if or (conv.ToBool (getenv "SC4S_ARCHIVE_GLOBAL" "no")) (conv.ToBool (getenv "SC4S_ARCHIVE_IETF_SYSLOG" "no")) }} | ||
| destination(d_archive); | ||
| {{- end}} | ||
|
|
||
| {{- if (print (getenv "SC4S_DEST_GLOBAL_ALTERNATES")) }} | ||
| {{ getenv "SC4S_DEST_GLOBAL_ALTERNATES" | regexp.ReplaceLiteral "^" "destination(" | regexp.ReplaceLiteral "[, ]+" ");\n destination(" }}); | ||
| {{- end }} | ||
|
|
||
| {{- if (print (getenv "SC4S_DEST_IETF_SYSLOG_ALTERNATES")) }} | ||
| {{ getenv "SC4S_DEST_IETF_SYSLOG_ALTERNATES" | regexp.ReplaceLiteral "^" "destination(" | regexp.ReplaceLiteral "[, ]+" ");\n destination(" }}); | ||
| {{- end }} | ||
|
|
||
| flags(flow-control,final); | ||
| }; |
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 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 |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| source s_ietf { | ||
| channel { | ||
| source { | ||
| syslog ( | ||
| transport("tcp") | ||
| port(601) | ||
| ip-protocol(4) | ||
| keep-hostname(yes) | ||
| keep-timestamp(yes) | ||
| use-dns(no) | ||
| use-fqdn(no) | ||
| chain-hostnames(off) | ||
| flags(validate-utf8, syslog-protocol) | ||
| ); | ||
| }; | ||
|
|
||
| if { | ||
| parser { app-parser(topic(syslog)); }; | ||
| }; | ||
| rewrite(set_rfc5424_strict); | ||
| parser { | ||
| vendor_product_by_source(); | ||
| }; | ||
| }; | ||
| }; |