feat(new sink): add dedicated syslog sink for RFC 5424/3164 output#25055
Open
tot19 wants to merge 1 commit intovectordotdev:masterfrom
Open
feat(new sink): add dedicated syslog sink for RFC 5424/3164 output#25055tot19 wants to merge 1 commit intovectordotdev:masterfrom
tot19 wants to merge 1 commit intovectordotdev:masterfrom
Conversation
Adds a new `syslog` sink that sends log events in syslog format over TCP, UDP, or Unix sockets. This wraps the existing socket transport utilities with the syslog codec hardcoded as the serializer, exposing syslog-specific options (rfc, facility, severity, app_name, proc_id, msg_id) at the top level for a first-class configuration experience. Closes vectordotdev#6863 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
syslogsink that sends log events in syslog format (RFC 5424 or RFC 3164) over TCP, UDP, or Unix sockets.This wraps the existing socket transport utilities (
TcpSinkConfig,UdpSinkConfig,UnixSinkConfig) with the syslog codec from #23777 hardcoded as the serializer. Syslog-specific options (rfc,facility,severity,app_name,proc_id,msg_id) are exposed at the top level for a first-class configuration experience — no need to manually wireencoding.codec = "syslog"through the socket sink.Thanks to @vparfonov, @polarathene, and @syedriko for the syslog encoder work in #23777 that made this possible.
Vector configuration
TCP (RFC 5424):
UDP (RFC 3164):
Unix socket:
TCP with TLS (RFC 5425):
How did you test this PR?
Unit tests — 8 tests covering all transport modes and both RFC formats:
generate_config— config round-trip through TOMLcomponent_spec_compliance— deserialize generated config, build sink, validate instrumentation eventstcp_syslog_rfc5424— TCP delivery with RFC 5424 version marker assertiontcp_syslog_rfc3164— RFC 3164 format parsed from TOML, negative assertion on version fieldtcp_syslog_custom_fields— customsyslog.app_namefield path wired through to outputtcp_multiple_events— 10 events verifying newline-delimited framing correctnessudp_syslog— UDP delivery with format verificationunix_stream_syslog— Unix domain socket delivery (#[cfg(unix)])All tests pass with
cargo test --no-default-features --features sinks-syslog -p vector --lib sinks::syslog.Local end-to-end test — Built Vector with the syslog sink and
demo_logssource, then ran it against local TCP and UDP listeners:demo_logs→ syslog sink → TCP listener on127.0.0.1:9514. Received properly formatted messages:demo_logs(JSON format) → syslog sink → UDP listener on127.0.0.1:9514. Received properly formatted messages:Both transports and RFC formats produce correct output end-to-end.
Change Type
Is this a breaking change?
Does this PR include user facing changes?
References
syslogsink #6863Notes
socketsink withencoding.codec = "syslog".OctetCountingEncoderin the codecs crate. Noted as a future option in a code comment.