Add agent-side UDP/TCP Syslog listener support to Logcollector - #877
Open
allamiro wants to merge 1 commit into
Open
Add agent-side UDP/TCP Syslog listener support to Logcollector#877allamiro wants to merge 1 commit into
allamiro wants to merge 1 commit into
Conversation
allamiro
force-pushed
the
feature/agent-side-syslog-listener-15178
branch
4 times, most recently
from
June 25, 2026 11:11
49a67c8 to
c21810d
Compare
allamiro
force-pushed
the
feature/agent-side-syslog-listener-15178
branch
from
June 25, 2026 13:16
c21810d to
83defd8
Compare
Add native agent-side Syslog listener support so the Wazuh agent can receive basic Syslog messages directly over UDP or TCP, instead of requiring an external service to write them to a file first. Received messages enter the existing Logcollector processing path and are sent through the standard agent-to-manager pipeline, remaining associated with the receiving agent. - New SyslogReader (IReader) implementing UDP and TCP listeners with the Boost.Asio coroutine model used by the other readers. - SetupSyslogReaders parses a new logcollector.syslog configuration section and creates one listener per definition; multiple independent listeners are supported. - Validation before any listener starts: protocol (udp/tcp), port range (1-65535), bind address, and duplicate protocol+address+port detection. Invalid or duplicate entries are logged and skipped, so no listener is silently enabled. bind_address defaults to 127.0.0.1. - Clean startup/shutdown: sockets are closed on the io_context thread and TCP client sockets are tracked and closed on stop. - Backward compatibility preserved for file, journald, windows and macOS collectors; manager-side remote Syslog is unchanged. - Unit tests for configuration parsing/validation and runtime UDP/TCP receipt, plus reference documentation and sample configuration. Related to wazuh/wazuh#15178.
allamiro
force-pushed
the
feature/agent-side-syslog-listener-15178
branch
from
August 6, 2026 18:51
cc5938a to
75e2ba0
Compare
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 native agent-side UDP/TCP Syslog listener support to the Wazuh Agent Logcollector.
This lets lightweight remote-site deployments forward basic Syslog directly to a local Wazuh agent over UDP or TCP, while preserving the normal agent-to-manager collection model. Received messages enter the existing Logcollector processing path, are sent through the standard encrypted/authenticated agent connection, and remain associated with the receiving agent (no manager-local
000ingestion).Related to wazuh/wazuh#15178.
What changed
SyslogReader(implements the existingIReaderinterface) providing UDP and TCP listeners using the project's Boost.Asio coroutine model.Logcollector::SetupSyslogReaders()parses a newlogcollector.syslogconfiguration section and creates one listener per definition.udp/tcp), port range (1–65535), bind address (make_address), and duplicateprotocol+address+portdetection. Invalid/duplicate entries are logged and skipped — no listener is ever silently enabled.Configuration
The new Wazuh 6.x agent uses YAML configuration (not the legacy XML
<localfile>), so the issue's proposed<location type="udp">is expressed in the existing YAML style, mirroring thejournaldcollector:Messages are pushed with the
remote-syslogcollector type and the listener identity (<protocol>:<address>:<port>) as the event provider.Validation
Built and tested on Linux (RHEL 9, GCC 11.5):
-Werror -Wconversion -Wsign-conversion -Wold-style-cast -Wshadow -Wpedantic …) — 0 warnings.Scope and future work
Issue #15178 proposes three ingress types for
localfile: UDP/TCP syslog, UNIX sockets, and pipes. This PR implements the UDP/TCP IP-socket listeners only (the part highlighted in the recent discussion). The remaining items are intentionally deferred and tracked as future work (documented in the module README and in a reference comment insyslog_reader.hpp):unix_stream/unix_dgram/unix_seq) — not included.<len> <msg>) are not auto-detected.bind_address— only numeric IPv4/IPv6 literals are accepted; DNS names are rejected by design.allowed-ipssource filtering — use host firewall rules until implemented.For high-volume ingestion, TLS Syslog, disk-assisted queues, advanced filtering, transformations, routing, or complex parsing pipelines, rsyslog, syslog-ng, Logstash, or the Wazuh manager remote Syslog input remain the recommended options. This change does not modify or replace any of them.