- OS Support
- Enterprise Edition Reference Manual
- 136. Man Pages
- 137. Configuration
- 138. Language
- 139. Extension Modules
- 140. Input Modules
- 141. Processor Modules
- 142. Output Modules
- 142.1. Microsoft Azure (om_azure)
- 142.2. Batched compression (om_batchcompress)
- 142.3. Blocker (om_blocker)
- 142.4. DBI (om_dbi)
- 142.5. Elasticsearch (om_elasticsearch)
- 142.6. EventDB (om_eventdb)
- 142.7. Program (om_exec)
- 142.8. File (om_file)
- 142.9. Go (om_go)
- 142.10. HTTP(s) (om_http)
- 142.11. Java (om_java)
- 142.12. Kafka (om_kafka)
- 142.13. Null (om_null)
- 142.14. ODBC (om_odbc)
- 142.15. Perl (om_perl)
- 142.16. Named pipes (om_pipe)
- 142.17. Python (om_python)
- 142.18. Raijin (om_raijin)
- 142.19. Redis (om_redis)
- 142.20. Ruby (om_ruby)
- 142.21. TLS/SSL (om_ssl)
- 142.22. TCP (om_tcp)
- 142.23. UDP (om_udp)
- 142.24. UDP with IP spoofing (om_udpspoof)
- 142.25. Unix domain sockets (om_uds)
- 142.26. WebHDFS (om_webhdfs)
- 142.27. ZeroMQ (om_zmq)
- NXLog Manager
- NXLog Add-Ons
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 which do not support other transports.
|To examine the supported platforms, see the list of installer packages in the Available Modules chapter.|
The module connects to the IP address or hostname defined in this directive. If additional hosts are specified on new lines, the module works in a failover configuration. If a destination becomes unavailable, the module automatically fails over to the next one. If the last destination becomes unavailable, the module fails over to the first destination.Note
Hostdirective is used with a hostname instead of an IP address, the the hostname will be resolved to an IP address for each new connection. If a resolver, e.g. DNS, returns multiple IP addresses, the module will connect to the first IP address. If a single output instance is configured with multiple Host directives or the resolver returns multiple addresses for a name, these hosts are accessed in failover mode. If a
Hostdirective is configured with a hostname, the product performs a name lookup and establishes the connection to the first reachable address in the returned set of addresses. The module will remain connected to that address until it is stopped, or the connection is severed. DNS changes are therefore not picked up by the module without intervention. If the connection fails to the first address of the set, the module will attempt to connect to the next address, until it reaches the end of the set of addresses. Then it performs a lookup on the next
Hostdirective, if so configured. Once all options are exhausted, the module will start over from the first
Hostdirective, cycling through them again until connection can be reestablished.Note
ListenAddr(or similar) directive specifies a hostname, the module binds to the first IP address that is exposed by the system for that hostname. On most systems that support IPv6, this address will be an IPv6 address. This means that client applications and the systems they run on will also need to have IPv6 support enabled, and must be able to connect to the same IPv6 address. NXLog output modules achieve this requirement through failover. For third-party client applications, the configuration details are application-specific but they should have the ability to detect which IP address the server is listening on when using a hostname to connect.
For client applications that don’t support IPv6, to avoid the behavior described above the
ListenAddrdirective of the listening module may be set to an IPv4 address e.g.
Alternatively, the server-side system may be configured to prioritize IPv4 addresses for the hostname specified by the
ListenAddrdirective, although this is a more complicated and potentially intrusive approach. On most Linux-based systems, this can be achieved through the
/etc/gai.confconfiguration file. On BSD-based systems, the
ip6addrctlcommand can be used. Windows is more limited and can only be configured to prioritize IPv4 over IPv6 addresses for ALL hostnames resolved on the system, by setting the following registry value to
For more information see the Microsoft documentation on Configuring IPv6 in Windows for advanced users.
This limitation will be addressed in a future release by making listening modules bind to all available IPv4/IPv6 addresses that a hostname resolves to.
The port number can be defined by appending it at the end of the hostname or IP address using a colon as a separator (
host:port). IPv6 addresses must be enclosed in square brackets (
[host]:port). For each destination with no port number defined here, the port number specified in the Port directive is used. Port numbers defined here take precedence over any port number defined in the Port directive. The default port is 514.
|Because of the nature of the UDP protocol and how ICMP messages are handled by various network devices, the failover functionality in this module is considered as "best effort". Detecting hosts going offline is not supported. Detecting the receiving service being stopped - while the host stays up is supported.|
The module connects to the port number on the destination host defined in this directive. This configuration is only used for any destination in the Host directive which does not have a port specified. If no port is configured for a destination in either directive, the default port is used, which is port 514.
|The Port directive will become deprecated from NXLog EE 6.0. After that, the port can only be defined in the Host directive.|
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.
Due to the required
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 doubles 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.
|The Reconnect directive must be used with caution. If it is used on multiple systems, it can send reconnect requests simultaneously to the same destination, potentially overloading the destination system. It may also cause NXLog to use unusually high system resources or cause NXLog to become unresponsive.|
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.
The following procedures are exported by om_udp.
Force a reconnection. This can be used from a Schedule block to periodically reconnect to the server.Caution
The reconnect() procedure must be used with caution. If configured, it can attempt to reconnect after every event sent, potentially overloading the destination system.
Pre-v5 syntax examples are included, they will become invalid with NXLog EE 6.0.
This configuration reads log messages from socket and forwards them via UDP.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 <Input uds> Module im_uds UDS /dev/log </Input> <Output udp> Module om_udp Host 192.168.1.1:1514 </Output> # Using the syntax prior to NXLog EE 5, # where the port is defined in a separate directive. #<Output udp> # Module om_udp # Host 192.168.1.1 # Port 1514 #</Output> <Route uds_to_udp> Path uds => udp </Route>
This configuration sends logs via UDP in a failover configuration (multiple Hosts defined).