From 2f97378f5cacb751c0bf4d75070de59924907894 Mon Sep 17 00:00:00 2001 From: Joshua Williams Date: Mon, 10 Aug 2020 15:13:03 -0400 Subject: [PATCH 1/2] Added syslog --- plugins/syslog.yaml | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 plugins/syslog.yaml diff --git a/plugins/syslog.yaml b/plugins/syslog.yaml new file mode 100644 index 00000000..9c0d58e4 --- /dev/null +++ b/plugins/syslog.yaml @@ -0,0 +1,52 @@ +# Plugin Info +version: 0.0.1 +title: Syslog +description: Log parser for Syslog +parameters: + listen_address: + label: Listen Address + description: A syslog address of the form `:` + type: string + default: ":514" + connection_type: + label: Connection Type + description: The type of syslog connection (`udp` or `tcp`) + type: enum + valid_values: + - udp + - tcp + default: udp + protocol: + label: Protocol + description: The protocol of received syslog messages (`rfc3164` or `rfc5424`) + type: enum + valid_values: + - rfc3164 + - rfc5424 + default: rfc5424 + +# Set Defaults +{{$listen_address := default ":514" .listen_address}} +{{$connection_type := default "udp" .connection_type}} +{{$protocol := default "rfc5424" .protocol}} + +# Pipeline Template +pipeline: +{{ if eq $connection_type "udp" }} + - id: syslog_input + type: udp_input + listen_address: {{ $listen_address }} + output: syslog_parser +{{ end }} + +{{ if eq $connection_type "tcp" }} + - id: syslog_input + type: tcp_input + listen_address: {{ $listen_address }} + output: syslog_parser +{{ end }} + + - id: syslog_parser + type: syslog_parser + protocol: {{ $protocol }} + output: {{ .output }} From 00485ba6e4a04e5b6d5466a42afc6ce37fcdc878 Mon Sep 17 00:00:00 2001 From: Joshua Williams Date: Tue, 11 Aug 2020 14:52:41 -0400 Subject: [PATCH 2/2] Update syslog.yaml --- plugins/syslog.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/syslog.yaml b/plugins/syslog.yaml index 9c0d58e4..3045ced6 100644 --- a/plugins/syslog.yaml +++ b/plugins/syslog.yaml @@ -36,6 +36,8 @@ pipeline: - id: syslog_input type: udp_input listen_address: {{ $listen_address }} + labels: + log_type: syslog output: syslog_parser {{ end }} @@ -43,6 +45,8 @@ pipeline: - id: syslog_input type: tcp_input listen_address: {{ $listen_address }} + labels: + log_type: syslog output: syslog_parser {{ end }}