UDP (om_udp)
This module sends log messages as UDP datagrams to the address and port specified. UDP is the transport protocol of the legacy BSD Syslog standard as described in RFC 3164, so this module can be particularly useful to send messages to devices or Syslog daemons that do not support other transports.
Configuration
The om_udp module accepts the following directives in addition to the common module directives. The Host directive is required.
Required directives
The following directives are required for the module to start.
The module connects to this IP address or hostname. If using a hostname, the module resolves the hostname to an IP address on each new connection. You can define the port number by appending it to the IP address or hostname using a colon as a separator ( IPv6 addresses must be enclosed in square brackets ( You can define this directive multiple times to connect to multiple hosts or ports in failover mode. Specify IPv4 and IPv6 addresses separately as needed. If you use a DNS name, you should keep the addresses or CNAMEs below 16 to avoid issues caused by DNS response size limits.
|
Optional directives
This optional directive specifies the local port number of the connection. If this is not specified, a random high port number will be used, which is not always ideal in firewalled network environments.
|
|||
See the OutputType directive in the list of common module directives. If this directive is not specified, the default is Dgram. |
|||
This optional directive sets the reconnect interval in seconds. If it is set, the module attempts to reconnect in every defined second. If it is not set, the reconnect interval will start at 1 second and double with every attempt. If the duration of the successful connection is greater than the current reconnect interval, then the reconnect interval will be reset to 1 sec.
|
|||
This optional directive defines the behavior when the connection with the remote host is lost.
When set to |
|||
This optional directive sets the socket buffer size (SO_SNDBUF) to the value specified. If this is not set, the operating system default is used. |
Examples
This configuration reads log messages from a socket and forwards them via UDP.
<Input uds>
Module im_uds
UDS /dev/log
</Input>
<Output udp>
Module om_udp
Host 192.168.1.1:1514
</Output>
<Route uds_to_udp>
Path uds => udp
</Route>
This configuration sends logs via UDP in a failover configuration (multiple Hosts defined).
<Output udp>
Module om_udp
Host 192.168.1.2:1514
Host 192.168.1.3:1514
Host example.com:1234
</Output>