-
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.
- Loading branch information
rfaircloth-splunk
committed
Apr 22, 2020
1 parent
c0ec0c8
commit 18fbe70
Showing
3 changed files
with
67 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 |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Linux/Unix OS system logs | ||
| {{- /* The following provides a unique port source configuration if env var(s) are set */}} | ||
| {{- $context := dict "port_id" "IETF_SYSLOG" "parser" "rfc3164" }} | ||
| {{- tmpl.Exec "t/source_network.t" $context }} | ||
|
|
||
| log { | ||
| junction { | ||
| channel { | ||
| # Listen on the default port (typically 514) 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(); | ||
| }; | ||
| }; | ||
| }; |