Expand description
The syslog node — ships per-request access-log entries to a remote syslog
server as RFC 5424 framed messages, over TCP or UDP, mirroring APISIX’s
syslog plugin (apisix/plugins/syslog/init.lua).
Each entry is built with the shared build_entry
helper, JSON-encoded, and wrapped in an RFC 5424 header
(<priority>1 timestamp hostname app-name procid - msg) exactly as APISIX
does via apisix/utils/rfc5424.lua. APISIX hard-codes facility SYSLOG (5)
and severity INFO (6), giving priority 5*8+6 = 46; the hostname is the
request Host and the procid is the gateway process id. The framed strings
are buffered in a BatchSink and flushed as a single concatenated payload
over a fresh TCP or UDP socket per flush.
Delivery is fire-and-forget on the request path — Plugin::execute pushes
the framed message and returns the context unchanged — so place this node in
the response pipeline after the upstream node.
§Deviations from APISIX
tlsis not yet supported;tls: trueis rejected at config load.flush_limit,drop_limit, andpool_sizeare accepted for schema compatibility but not honored; batching is governed by the sharedBatchConfigknobs instead.
Structs§
- Syslog
Flusher 🔒 BatchFlusherthat concatenates the framed messages and sends them over TCP or UDP.- Syslog
Plugin - The
syslogplugin node.
Enums§
- Sock
Type 🔒 - Transport for the syslog socket.
Constants§
- FACILITY_
SYSLOG 🔒 - Syslog facility
SYSLOG(5), matching APISIX’s hard-coded choice. - SEVERITY_
INFO 🔒 - Syslog severity
INFO(6), matching APISIX’s hard-coded choice.
Functions§
- build_
syslog_ 🔒frame - Builds one RFC 5424 syslog frame. Pure and independent of the clock/network (the timestamp is passed in) so it can be unit-tested against a known value.
- format_
rfc3339 🔒 - Formats an epoch-seconds/millis pair as an RFC 3339 Zulu timestamp using the civil-from-days algorithm (no external date crate).
- priority 🔒
- RFC 5424 priority value:
facility * 8 + severity. - rfc3339_
now 🔒 - Current time as an RFC 3339 “Zulu” timestamp (
YYYY-MM-DDTHH:MM:SS.mmmZ), matching APISIX’sget_rfc3339_zulu_timestamp.