Skip to main content

Syslog

Forward

Synopsis

Creates a target that forwards log messages to a remote syslog server. Supports multiple transport protocols, message templating, and TLS encryption.

note

The syslog target uses the RFC5424 format for all messages, ensuring modern syslog compatibility.

Schema

- id: <numeric>
name: <string>
description: <string>
type: syslog
pipelines: <pipeline[]>
status: <boolean>
properties:
type: <string>
address: <string>
port: <numeric>
format: <string>
template: <string>
app_name: <string>
priority: <numeric>
tls:
status: <boolean>
verify: <boolean>
cert_name: <string>
key_name: <string>

Configuration

The following are the minimum requirements to define the target.

FieldRequiredDefaultDescription
idYUnique identifier
nameYTarget name
descriptionN-Optional description
typeYMust be syslog
pipelinesN-Optional post-processor pipelines
statusNtrueEnable/disable the target

Connection

FieldRequiredDefaultDescription
typeN"udp"Transport protocol: udp, tcp, or tls
addressN"127.0.0.1"Remote server address
portN514Remote server port

Messages

FieldRequiredDefaultDescription
templateN"<{{.Priority}}> {{.Timestamp}} {{.AppName}}[{{.PID}}]: {{.Message}}"Message template
app_nameN"vmetric"Application name in the messages
priorityN14Syslog priority value
formatN-Field normalization format: ecs, cim, asim, cef, leef, csl

TLS

FieldRequiredDefaultDescription
tls.statusNfalseEnable TLS encryption
tls.verifyNfalseVerify server certificate
tls.cert_nameN"cert.pem"Client certificate file
tls.key_nameN"key.pem"Client private key file
warning

When using TLS, ensure that the certificate files are accessible and have the appropriate permissions.

Templates

The following variables can be used in the message template:

VariableDescriptionExample
{{.Year}}Current year2024
{{.Month}}Current month01
{{.Day}}Current day15
{{.Priority}}Syslog priority14
{{.Timestamp}}RFC3339 timestamp2024-01-15T14:30:00Z
{{.AppName}}Application namevmetric
{{.PID}}Process ID1234
{{.Message}}Log messageUser login successful
note

Invalid templates will fall back to sending the raw message content without formatting.

Examples

Basic UDP

The minimum configuration for a UDP syslog:

- id: 1
name: udp_syslog
type: syslog
properties:
address: "192.168.1.100"

Secure TLS

Configuration for a TLS-encrypted syslog:

- id: 2
name: secure_syslog
type: syslog
properties:
type: "tls"
address: "logs.example.com"
port: 6514
tls:
status: true
verify: true
cert_name: "client-cert.pem"
key_name: "client-key.pem"

Template

Configuration with a custom message template:

- id: 3
name: custom_syslog
type: syslog
properties:
address: "192.168.1.100"
template: "{{.Timestamp}} [{{.AppName}}] severity={{.Priority}} {{.Message}}"
app_name: "myapp"
priority: 13