When you send your log messages from a syslog-ng PE client through the network to a syslog-ng PE server, you can use different protocols and options. Every combination has its advantages and disadvantages. The most important thing is to use matching protocols and options, so the server handles the incoming log messages properly.
In syslog-ng PE you can change many aspects of the network communication. First of all, there is the structure of the messages itself. Currently, syslog-ng PE supports two standard syslog protocols: the BSD (RFC3164) and the syslog (RFC5424) message format.
These RFCs describe the format and the structure of the log message, and add a (lightweight) framing around the messages. You can set this framing/structure by selecting the appropriate driver in syslog-ng PE. There are two drivers you can use: the network() driver and the syslog() driver. The syslog() driver is for the syslog (RFC5424) protocol and the network() driver is for the BSD (RFC3164) protocol.
The tcp() and udp() drivers are now deprecated, they are essentially equivalent with the network(transport(tcp)) and network(transport(udp)) drivers.
In addition to selecting the driver to use, both drivers allow you to use different transport-layer protocols: TCP and UDP, and optionally also higher-level transport protocols: TLS (over TCP, and ALTP (optionally using TLS). To complicate things a bit more, you can configure the network() driver (corresponding to the BSD (RFC3164) protocol) to send the messages in the syslog (RFC5424) format (but without the framing used in RFC5424) using the flag(syslog-protocol) option.
Because some combination of drivers and options are invalid, you can use the following drivers and options as sources and as destinations:
-
syslog(transport(tcp))
-
syslog(transport(udp))
-
syslog(transport(altp))
-
syslog(transport(tls))
-
syslog(transport(altp(tls-required(yes)))
-
network(transport(tcp))
-
network(transport(udp))
-
network(transport(altp))
-
network(transport(tls))
-
network(transport(altp(tls-required(yes)))
-
network(transport(tcp) flag(syslog-protocol))
-
network(transport(udp) flag(syslog-protocol))
-
network(transport(altp)flag(syslog-protocol))
-
network(transport(tls) flag(syslog-protocol))
-
network(transport(altp(tls-required(yes)) flag(syslog-protocol))
If you use the same driver and options in the destination of your syslog-ng PE client and the source of your syslog-ng PE server, everything should work as expected. Unfortunately there are some other combinations, that seem to work, but result in losing parts of the messages. The following table show the combinations:
Source \ Destination | syslog/tcp | syslog/udp | syslog/tls | network/tcp | network/udp | network/tls | network/tcp/flag | network/udp/flag | network/tls/flag |
---|---|---|---|---|---|---|---|---|---|
syslog/tcp | ✔ | - | - | ! | - | - | ! | - | - |
syslog/udp | - | ✔ | - | - | ! | - | - | ! | - |
syslog/tls | - | - | ✔ | - | - | ! | - | - | ! |
network/tcp | - | - | - | ✔ | - | - | ✔? | - | - |
network/udp | - | ✔? | - | - | ✔ | - | - | ✔? | - |
network/tls | - | - | - | - | - | ✔ | - | - | ✔? |
network/tcp/flag | ! | - | - | ! | - | - | ✔ | - | - |
network/udp/flag | - | ! | - | - | ! | - | - | ✔ | - |
network/tls/flag | - | - | ! | - | - | ! | - | - | ✔ |
-
- This method does not work. The logs will not get to the server.
-
✔ This method works.
-
! This method has some visible drawbacks. The logs go through, but some of the values are missing/misplaced/and so on.
-
✔? This method seems to work, but it is not recommended because this can change in a future release.
NOTE: To receive UDP messages at very high message rate, you can use the udp-balancer() source. For details, see udp-balancer: Receiving UDP messages at very high rate.