How to determine if syslog is listening using netcat

By   01-18-2015 · 1 minute read · 115 words


During my weekend adventures of playing with HAProxy and syslog, I needed to figure out if a configured syslog server was listening on the other end. After opening up iptables rules and configuring the syslog receiver, it was time to send some test messages.

To do this, I used netcat.

nc -w0 -u yourlogserver.dky.io 514 <<< "sometest log event"

This will send a single event to your log server. Hopefully if you configured logging correctly you should see it come through.To validate the message isn’t getting blocked and hitting your server you can run tcpdump:

sudo tcpdump -i eth0 -n udp port 514 -vvv

If messages are coming through, you should see hits thorugh tcpdump.

syslog  

comments powered by Disqus