Getting Data In

Splunk Receiving Syslog Mesages via TCP or UDP

scornish
Engager

All, I'm going to configure Splunk to receive Syslog messages and have not yet decided which transport protocol I will be using.

I'm thinking of just sticking with UDP devices some of my devices may only be able to send messages using UDP.

Besides the normal preferences for TCP over UDP, why is it strongly recommended to configure Splunk to receive Syslog messages via TCP instead of UDP?

Stephanie

Tags (1)

krugger
Communicator

I would argue that the preference for TCP is because UDP syslog messages are truncated at around 1K bytes. So if you intend to have long messages coming in via syslog you should chose TCP.

gkanapathy
Splunk Employee
Splunk Employee

It is not strongly recommended from Splunk to favor TCP over UDP in general. This will be dictated by your own requirements. In cases where delivery of log messages needs to be guaranteed, you will have to use TCP. Similarly, if you need to encrypt the data connection, you should use TCP. However, if (for example) your application logs directly over TCP and the local queue fills up, then your application will block or have to wait to write its own log messages. In many cases, this will be be unacceptable as it will probably cause severe application performance degradation. In such cases, UDP will be preferred.

Simeon
Splunk Employee
Splunk Employee

The recommendation partially stems from the protocol itself. UDP does not provide guarantee of delivery which can cause data to go missing. Specific to Splunk, the tcp connection will log additional metrics (like source host) within Splunk. When considering connection problems or missing data, the TCP connection is much more desirable.

Lowell
Super Champion

You can setup both at the same time. You may also want to consider setting up syslog-ng in front of splunk due to splunk downtime and disk persistence issues. See the following splunk blog for some additional info:

0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...