Getting Data In

Splunk not receiving syslog events, but telnet works

bclapp
New Member

I've got splunk working properly on a CentOS 6.5 box. I have another CentOS box client, and I can telnet to the port 8001 on the splunk box and send events, and they show up in splunk. But rsyslog events don't ever show up in splunk.

Here's the only modification that I made to the end of /etc/rsyslog.conf:

# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
*.* @@splunk.mydomain.com:8001

And here's what happens when I telnet to it:

[root@app ~]# telnet splunk.mydomain.com 8001
Trying 10.1.3.203...
Connected to splunk.mydomain.com.
Escape character is '^]'.
hi
^]
telnet> quit
Connection closed.

And that results in a "hi" event showing up in splunk.

Now, if I log something from the command line, it shows up in /var/log/messages:

[root@app ~]# tail /var/log/messages -n 1
Mar 12 16:00:13 app test: WHATEVER BRO

But I get nothing new in splunk, and a search for "WHATEVER BRO" turns up nothing... What am I missing?

Thanks!

0 Karma

toby_meyer
Engager

Hey I'm sure you moved on to the forwarder (as one should noted by starcher), but if anyone else stumbles upon this I thought I should post up the answer.

This is likely a SELinux problem; it will block outgoing connections on "non-standard" ports on a per-server basis. To fix, you'll need to add your custom port to the service definition for syslog (rsyslog is launched as syslog for policy purposes) or disable SELinux. To test without rebooting, you can try the command setenforce 0 (not persistent across reboots). If it works after that, there's your problem. I might write up a tutorial post later, if so I'll circle back and link it.

That said, I'm moving on to the forwarder as starcher suggests; just couldn't let this one go due to its odd behavior!

0 Karma

starcher
Influencer

can you list what the setup of the network port on the Splunk side is that you setup? However is it normally not a good idea to send syslog straight to splunk. Use the universal forwarder on your linux system running rsyslog. Have rsyslog write logs to folders and use the universal forwarder to pick up those folders and send to splunk. This lets you choose different indexes and source types depending on what the log data actually is based on each source being collected.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...