Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added syslog #21

Merged
merged 2 commits into from
Aug 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions plugins/syslog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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 `<ip>:<port>`
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 }}
labels:
log_type: syslog
output: syslog_parser
{{ end }}

{{ if eq $connection_type "tcp" }}
- id: syslog_input
type: tcp_input
listen_address: {{ $listen_address }}
labels:
log_type: syslog
output: syslog_parser
{{ end }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one seems to be missing the syslog_parser

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you just missed it down below. It exists outside of the conditional statements. That way we didn't need to define the same parser twice for each conditional.


- id: syslog_parser
type: syslog_parser
protocol: {{ $protocol }}
output: {{ .output }}