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 protocols.
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 directive is required for the module to start.
Set this directive to the IP address or hostname of the remote host to connect to. If you specify a hostname, the module resolves it to an IP address on each new connection. The module uses port 514 by default.
To connect to a different port, add the port number after the IP address or hostname, separated by a colon ( Enclose IPv6 addresses in square brackets ( You can set this directive more than once to allow failover between different hosts or ports. List IPv4 and IPv6 addresses separately if needed. If you use a DNS name, make sure it resolves to fewer than 16 addresses or CNAMEs to prevent problems with DNS response size limits.
|
Optional directives
Set this directive to the local port number to use for the connection, for example to satisfy a firewall rule that expects traffic from a known port. If you do not set this directive, the module uses a random high port number, which a firewall may block.
|
|||
See the OutputType directive in the list of common module directives. If this directive is not specified, the default is Dgram. |
|||
Set this directive to the number of seconds to wait between reconnection attempts. If you do not set this directive, the module starts with a 1 second interval and doubles it after each failed attempt, resetting to 1 second once it reconnects successfully.
|
|||
Set this directive 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. |
|||
Set this directive to
The default is |
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>