Support Logging setup Syslog-ng TLS configuration

Syslog-ng TLS Configuration

You can securely send your logs to Loggly using TLS encryption. This guide shows you how to set it up for syslog-ng on Linux.

Syslog-ng TLS Configuration Setup

1. Install the necessary security certificate

Create a ca.d directory if one does not exist and download the necessary certificate

mkdir -pv /opt/syslog-ng/keys/ca.d
cd /opt/syslog-ng/keys/ca.d/
curl -O

2. Update Configuration file

Open up the configuration file (syslog-ng.conf) and update the content by replacing the configuration given below.

sudo vim /etc/syslog-ng/syslog-ng.conf

### Syslog-ng Logging Directives for ###
source s_loggly {
    system();	# Check which OS & collect system logs
    internal();	# Collect syslog-ng logs

template LogglyFormat { template("<${PRI}>1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} [TOKEN@41058 tag=\"syslog-ng\"] $MSG\n");

destination d_loggly {
    tcp("" port(6514) 
    tls(peer-verify(required-untrusted) ca_dir('/opt/syslog-ng/keys/ca.d/'))


log { 
### END Syslog-ng Logging Directives for ###


Restart the syslog-ng service for the changes to take place.

NOTE: Syslog-ng over TLS uses port 6514, so make sure to update your syslog-ng configuration

3. Verify Events

Search Loggly for events with the logtype as syslog over the past hour. It may take few minutes to index the event. If if doesn’t work, see the troubleshooting section below.



Advanced Syslog-ng TLS Configuration Options

Troubleshooting Your Syslog-ng TLS Configuration

  • Wait a few minutes in case indexing needs to catch up
  • Make sure you restarted syslog-ng
  • Syslog over TLS uses port 6514, so check that you’ve updated your rsyslog configuration
  • Make sure port 6514 outbound is open on your firewall and network settings
  • Run “sudo tcpdump -i lo -A udp and port 6514″ to verify UDP events are being sent to localhost
  • Verify your operating system has support for TLS 1.1 or 1.2. Older OSes like CentOS 5 do not have support, but CentOS 6 and higher do.
  • Search or post your own syslog-ng TLS questions in the community forum.
Thanks for the feedback! We'll use it to improve our support documentation.