Sending Logs to Graylog
A Graylog stack is only useful once log sources are pointing at it. This guide wires three common client types into the Dockerised Graylog from the previous article: Linux via rsyslog (the universal, agentless route), Windows via the Graylog Sidecar managing Winlogbeat (the recommended way to ship Windows Event Logs), and macOS via its built-in syslog daemon. Each client targets a matching input you create once on the Graylog server.
In the Docker article, the example Compose file binds every input port to 127.0.0.1, meaning only the Graylog host itself can connect. Before any remote client can send a single line, you must publish those ports on a routable interface and restart the container.
Two halves have to agree: a collector on the client sends in a particular format and protocol, and an input on the Graylog server listens for exactly that. Mismatch either side and messages silently never appear.
| Client / Collector | Graylog input | Default port |
|---|---|---|
| rsyslog (Linux/macOS), plain syslog | Syslog UDP / Syslog TCP | 5140 |
| rsyslog with GELF template | GELF UDP / GELF TCP | 12201 |
| Winlogbeat / Filebeat (via Sidecar) | Beats | 5044 |
| Your own app code | GELF HTTP | 12201 (or custom) |
Nearly every Linux distribution already runs rsyslog. The fastest path is to forward all messages in RFC 5424 format to a Syslog input — no extra software, no templates. First create a Syslog UDP (or TCP) input on port 5140 in Graylog, then drop a small config file on the client.
Open Search in Graylog and the test line should appear within a second or two, tagged with the client's hostname.
@ means UDP, @@ means TCP. RFC 5424 (RSYSLOG_SyslogProtocol23Format) gives Graylog clean, parseable timestamps and structured fields — prefer it over the legacy format.Plain syslog is fine for system messages, but GELF (Graylog Extended Log Format) carries structured fields and avoids syslog's length and escaping quirks. Define a GELF template in rsyslog and point an output action at a GELF input on port 12201.
The recommended way to ship Windows Event Logs is the Graylog Sidecar — a lightweight service that manages the Winlogbeat collector and pulls its configuration centrally from Graylog. You configure once in the web UI; every tagged Windows host picks it up. Start by preparing Graylog.
| Step | Where |
|---|---|
| Launch a Beats input on port 5044, ticked Global | System / Inputs |
Create an API token for the graylog-sidecar user | System / Sidecars → Administration |
Download the Sidecar installer (the .exe) from Graylog's GitHub releases, matching the version to your server. Install it interactively, or silently from an elevated prompt:
server_url (it has to end in /api) and server_api_token in C:\Program Files\Graylog\sidecar\sidecar.yml. Registration only succeeds when the host can reach the REST API on port 9000.Back in Graylog the host now appears under System / Sidecars. Create (or reuse) a Winlogbeat configuration that reads the Windows event channels and ships them to your Beats input. The two fields lines at the top are required for Graylog to attribute messages to the right collector.
Assign the configuration to the host's Winlogbeat collector and click Start. Within a minute the Sidecar generates the local config, launches Winlogbeat, and Windows events begin landing in Graylog's Search.
output.logstash block is correct even though you created a "Beats" input — Beats and the Logstash output speak the same Lumberjack protocol. If you also run Sysmon, add a channel line - name: Microsoft-Windows-Sysmon/Operational to capture it.windows-servers vs workstations) if different machines need different channels or filters.macOS keeps its modern logs in the unified logging system, but the classic BSD syslog daemon still runs and is the simplest bridge to Graylog. Point it at the same Syslog input the Linux hosts use (port 5140). Edit the syslog configuration and add a forwarding rule.
For more than the basic facilities, install rsyslog via Homebrew (brew install rsyslog) and use the exact same RFC 5424 or GELF configs shown in the Linux sections — the rsyslog config syntax is identical across platforms.
log stream output into a script that posts to a GELF HTTP input. That's an application-level integration rather than a daemon config, but it's the route to Apple's structured logs.| Symptom | Check |
|---|---|
| No messages at all | Input running & Global? Compose port published (not bound to 127.0.0.1)? Host firewall open? |
| Input shows 0 received | Client port/protocol must match the input exactly (UDP vs TCP, 5140 vs 12201) |
| Windows host absent | Sidecar can't reach server_url (must end in /api on port 9000); token valid? |
| Test a UDP syslog input | echo "<34>test" | nc -u -w1 your-graylog-ip 5140 |
| Watch the input live | System / Inputs → the input's "Received messages" / "Show received messages" |
| Item | Value |
|---|---|
| Web & REST API | 9000/tcp |
| Syslog input | 5140/udp + 5140/tcp |
| GELF input | 12201/udp + 12201/tcp |
| Beats input (Sidecar) | 5044/tcp |
| Linux rsyslog drop-in | /etc/rsyslog.d/90-graylog.conf |
| Windows Sidecar config | C:\Program Files\Graylog\sidecar\sidecar.yml |
| macOS syslog config | /etc/syslog.conf |
