Despite the haters in the comments, UDP is awesome for certain things - such as high performance logging.
I would look at the receive buffer size - if you send a datagram larger than the buffer, it will truncate the datagram.
When receiving messages using the UDP protocol, increase the size of the UDP receive buffer on the receiver host (that is, the syslog-ng OSE server or relay receiving the messages). Note that on certain platforms, for example, on Red Hat Enterprise Linux 5, even low message load (~200 messages per second) can result in message loss, unless the so_rcvbuf() option of the source is increased. In such cases, you will need to increase the net.core.rmem_max parameter of the host (for example, to 1024000), but do not modify net.core.rmem_default parameter.
As a general rule, increase the so_rcvbuf() so that the buffer size in kilobytes is higher than the rate of incoming messages per second. For example, to receive 2000 messages per second, set the so_rcvbuf() at least to 2 097 152 bytes.
(source: https://www.balabit.com/sites/default/files/documents/syslog-ng-ose-3.3-guides/en/syslog-ng-ose-v3.3-guide-admin-en/html/reference_source_tcpudp.html)
I also haven't used nc
for UDP specifically, so I'm not sure if it does any modification of the data. You could use tcpdump -xvv dst port 9514
to validate what the UDP datagrams actually are being sent as. Typically, I just pipe directly to: tail -f -n0 /var/log/nodejs/log.log > /dev/udp/serverhostnamehere/9996