The purpose of this knowledge base article is to help configuring syslog-ng for high incoming UDP log traffic. Many applications and devices can only send the logs over UDP. In a large environment it can happen that syslog-ng can not handle the incoming traffic and message loss happens.
UDP packets are getting dropped.
Before start, it is strongly recommended to check the sender hosts and devices if possible to change the sending protocol to TCP instead of UDP.
Use UDP only if there is no other choice.
sysctl -a |grep rmem_max
net.core.rmem_max = 212992
netstat -unlp|grep -e PID -e syslog
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
udp 212864 0 10.21.10.20:514 0.0.0.0:* 3503/syslog-ng
netstat -su
Udp:
6798 packets received
29 packets to unknown port received.
34 packet receive errors
6833 packets sent
source s_network {
udp-balancer(
ip("192.168.1.1")
);
};
The following solutions can be applied separately and also can be combined.
Solution 2A - Increasing kernel's receive buffer size
Add the following line or modify the existing one in /etc/sysctl.conf. Change the size based on your UDP traffic, but it's a good start to double the default size.
net.core.rmem_max = 425984
Solution 2B - Configuring multiple UDP sources
The sources can be configured listening on a unique UDP port or IP address.
Example - Different UDP port
source s_udp1 { network(transport(udp) port(514));
source s_udp2 { network(transport(udp) port(515));
Example - Different IP address on default port UDP/514
Note: Syslog-ng does not manage IP addresses. IP must be assigned in the OS.
source s_udp1 { network(ip(192.168.1.1));
source s_udp2 { network(ip(192.168.1.2));
© 2024 One Identity LLC. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center