Skip to main content

Syslog Receiver

The syslog section configures a native syslog receiver that listens for log messages over UDP (RFC 5426) and TCP (RFC 6587). LynxDB parses incoming messages using RFC 5424, RFC 3164, or a raw pass-through dialect and writes them to the storage engine through the same ingest pipeline used by the HTTP API.

The syslog receiver is disabled by default. Set at least one listen address (udp or tcp) to enable it.

Quick Start

# Enable syslog on UDP and TCP port 514
lynxdb server --syslog :514

# UDP only on port 5514
lynxdb server --syslog-udp :5514

# TCP with TLS on port 6514
lynxdb server --syslog-tcp :6514 --syslog-tls

Or in a config file:

syslog:
udp: ":514"
tcp: ":514"

Point any syslog-capable device or agent at the configured address:

# rsyslog
*.* @@lynxdb-host:514

# syslog-ng
destination d_lynxdb { tcp("lynxdb-host" port(514)); };

Listen Addresses

syslog.udp

Config Keysyslog.udp
Env VarLYNXDB_SYSLOG_UDP
Default(empty, disabled)

UDP listen address in host:port format. When empty, the UDP receiver is disabled.

syslog:
udp: ":514"

UDP is connectionless and suited for high-throughput fire-and-forget logging. Each datagram carries one syslog message.

syslog.tcp

Config Keysyslog.tcp
Env VarLYNXDB_SYSLOG_TCP
Default(empty, disabled)

TCP listen address in host:port format. When empty, the TCP receiver is disabled.

syslog:
tcp: ":514"

TCP provides reliable, ordered delivery and supports connection-level batching. Most production syslog deployments use TCP.

syslog.tls

Config Keysyslog.tls
Env VarLYNXDB_SYSLOG_TLS
Defaultfalse

Wrap the TCP listener with the server TLS configuration. Requires TLS to be configured at the server level (tls.enabled: true or --tls). When --syslog-tcp is used without an explicit port and TLS is enabled, the default port becomes 6514 (the IANA-assigned port for syslog over TLS).

tls:
enabled: true
cert_file: /etc/ssl/lynxdb.crt
key_file: /etc/ssl/lynxdb.key

syslog:
tcp: ":6514"
tls: true

Parser

syslog.parser

Config Keysyslog.parser
Env VarLYNXDB_SYSLOG_PARSER
Defaultauto

Controls how incoming syslog messages are parsed:

ValueDescription
autoDetect dialect per message: RFC 5424 if the version digit is present, RFC 3164 for BSD-style pri headers, raw otherwise. Default.
rfc5424Parse all messages as RFC 5424. Unparseable messages are stored as raw with _parse_error=true.
rfc3164Parse all messages as RFC 3164 (BSD syslog). Unparseable messages are stored as raw with _parse_error=true.
rawNo parsing. The full message is stored in _raw as-is.

Extracted fields

Successful parsing extracts the following fields:

FieldRFC 5424RFC 3164Description
facilityyesyesNumeric facility code (0--23)
facility_labelyesyesHuman-readable label: kern, user, daemon, local0--local7, etc.
severityyesyesNumeric severity (0--7)
severity_labelyesyesHuman-readable label: emerg, alert, crit, err, warning, notice, info, debug
levelyesyesAlias for severity_label
hostyesyesHostname from the syslog header
app_nameyesyesApplication name (RFC 5424) or tag (RFC 3164)
procidyesyesProcess ID
msgidyesnoMessage ID
messageyesyesFree-form message text
sd_*yesnoStructured data parameters, flattened as sd_<SD-ID>_<param-name>

The sourcetype is set to <base>:<dialect> (e.g., syslog:rfc5424, syslog:rfc3164, syslog:raw).

Framing

syslog.framing

Config Keysyslog.framing
Env VarLYNXDB_SYSLOG_FRAMING
Defaultauto

Controls how TCP message boundaries are detected:

ValueDescription
autoDetect per connection: if the first byte is a digit, use octet-counting; otherwise use non-transparent framing. Default.
octet-countingRFC 6587 octet-counting framing. Each frame is <length> <message>.
non-transparentRFC 6587 non-transparent framing. Messages are delimited by a trailer character.

Framing applies only to TCP. UDP datagrams carry one message each and do not use framing.

syslog.trailer

Config Keysyslog.trailer
Env VarLYNXDB_SYSLOG_TRAILER
Defaultauto

Trailer character for non-transparent framing. Only used when framing is (or auto-detects as) non-transparent.

ValueDescription
autoDetect the trailer from the first message: \n (LF), \0 (NUL), or \r\n (CRLF). Default.
lfLine feed (\n)
nulNull byte (\0)
crlfCarriage return + line feed (\r\n)

Timestamps and Hostname

syslog.default_timezone

Config Keysyslog.default_timezone
Env VarLYNXDB_SYSLOG_DEFAULT_TIMEZONE
DefaultLocal

Timezone used to interpret RFC 3164 timestamps, which do not include timezone or year information. Accepts Local (server timezone) or any IANA timezone name such as UTC, America/New_York, Europe/Berlin.

RFC 5424 timestamps include full timezone information and are not affected by this setting.

syslog:
default_timezone: "UTC"

syslog.default_hostname

Config Keysyslog.default_hostname
Env VarLYNXDB_SYSLOG_DEFAULT_HOSTNAME
Default(empty)

Hostname to assign when the wire value is missing or -. When empty, the event host is left unset for such messages.

syslog:
default_hostname: "unknown"

Routing

syslog.index

Config Keysyslog.index
Env VarLYNXDB_SYSLOG_INDEX
Defaultmain

Target index for all syslog events.

syslog:
index: "syslog"

syslog.sourcetype

Config Keysyslog.sourcetype
Env VarLYNXDB_SYSLOG_SOURCETYPE
Defaultsyslog

Base sourcetype for syslog events. The parsed dialect is appended as a suffix: syslog:rfc5424, syslog:rfc3164, or syslog:raw.

syslog:
sourcetype: "syslog"

syslog.use_peer_as_source

Config Keysyslog.use_peer_as_source
Env VarLYNXDB_SYSLOG_USE_PEER_AS_SOURCE
Defaulttrue

Set the event _source to the peer address (udp://host:port or tcp://host:port). When false, the source field is left empty.

Size and Connection Limits

syslog.max_message_bytes

Config Keysyslog.max_message_bytes
Env VarLYNXDB_SYSLOG_MAX_MESSAGE_BYTES
Default65536 (64 KB)

Maximum size of a single syslog message in bytes. Messages exceeding this limit are dropped. Must be at least 1024.

syslog:
max_message_bytes: 131072

syslog.udp_read_buffer

Config Keysyslog.udp_read_buffer
Env VarLYNXDB_SYSLOG_UDP_READ_BUFFER
Default2mb

UDP socket receive buffer size. Increase on high-throughput UDP receivers to reduce kernel-level drops.

syslog:
udp_read_buffer: "4mb"

syslog.tcp_idle_timeout

Config Keysyslog.tcp_idle_timeout
Env VarLYNXDB_SYSLOG_TCP_IDLE_TIMEOUT
Default5m

Idle timeout for TCP connections. Connections with no data within this period are closed.

syslog:
tcp_idle_timeout: "10m"

syslog.tcp_max_connections

Config Keysyslog.tcp_max_connections
Env VarLYNXDB_SYSLOG_TCP_MAX_CONNECTIONS
Default1000

Maximum number of concurrent TCP syslog connections. New connections exceeding this limit are immediately closed.

syslog:
tcp_max_connections: 5000

Batching

Syslog events are batched in memory before being flushed to the storage engine.

syslog.batch_size

Config Keysyslog.batch_size
Env VarLYNXDB_SYSLOG_BATCH_SIZE
Default1000

Number of events to accumulate before flushing a batch.

syslog.batch_timeout

Config Keysyslog.batch_timeout
Env VarLYNXDB_SYSLOG_BATCH_TIMEOUT
Default200ms

Maximum time to wait before flushing an incomplete batch. Triggers regardless of batch size when the timeout expires.

CLI Flags

The lynxdb server command supports these syslog-related flags:

FlagDescription
--syslog <addr>Enable both UDP and TCP syslog on the given address (default port 5514 when omitted)
--syslog-udp <addr>Enable UDP syslog only
--syslog-tcp <addr>Enable TCP syslog only (default port 6514 when --syslog-tls is set)
--syslog-tlsWrap TCP syslog with server TLS
--syslog-parser <dialect>Parser dialect: auto, rfc5424, rfc3164, raw
--syslog-index <name>Target index for syslog events

Hot-Reloadable Settings

The following syslog settings can be reloaded without restarting the server (SIGHUP or lynxdb config reload):

  • syslog.index
  • syslog.sourcetype
  • syslog.default_timezone
  • syslog.default_hostname
  • syslog.batch_size
  • syslog.batch_timeout

Listen addresses (udp, tcp), TLS, parser, framing, trailer, and connection limits require a server restart.

Prometheus Metrics

The syslog receiver exposes these Prometheus metrics:

MetricTypeLabelsDescription
lynxdb_syslog_messages_received_totalcountertransport, dialectTotal messages received
lynxdb_syslog_messages_dropped_totalcountertransport, reasonTotal messages dropped (toolarge, conn_limit, backpressure)
lynxdb_syslog_active_connectionsgaugetransport=tcpCurrent active TCP connections
lynxdb_syslog_parse_errors_totalcounterdialectTotal parse errors

Complete Example

syslog:
udp: ":514"
tcp: ":514"
tls: false
parser: auto
framing: auto
trailer: auto
default_timezone: "UTC"
default_hostname: ""
index: "main"
sourcetype: "syslog"
use_peer_as_source: true
max_message_bytes: 65536
udp_read_buffer: "2mb"
tcp_idle_timeout: "5m"
tcp_max_connections: 1000
batch_size: 1000
batch_timeout: "200ms"

Tuning Guidelines

ScenarioRecommendation
High-throughput network devicesUse UDP, increase udp_read_buffer to 4mb or higher
Reliable delivery requiredUse TCP with octet-counting framing
Security / complianceEnable TLS on TCP port 6514
Many sendersIncrease tcp_max_connections
Low-latency flushDecrease batch_timeout to 50ms
Large structured messagesIncrease max_message_bytes
RFC 3164 devices in non-local timezoneSet default_timezone explicitly

Next Steps