You can configure Linux to send logs to Loggly through the default syslog daemon installed with your distribution, so there are no proprietary agents needed. This guide will configure your system to send the standard Linux system logs, and offer a foundation to monitor file and application logs.
This Linux logging guide assumes you have sudo access, you’re on a common linux distribution with rsyslog 5.8 or higher, it receives local system logs, and port 514 is open to outbound connections. If you have different requirements, please see the Advanced Options below.
Linux Logging Setup
1. Configure Syslog Daemon
curl -O https://www-staging.loggly.com/install/configure-linux.sh sudo bash configure-linux.sh -a SUBDOMAIN -u USERNAME
- SUBDOMAIN: your account subdomain that you created when you signed up for Loggly
- USERNAME: your Loggly username, which is visible at the top right of the Loggly console
You will need to enter your system root password so it can update your rsyslog configuration. It will then prompt for your Loggly password.
2. Send A Test Event
Use Logger to send a test event to Loggly.
logger 'Hello World!'
Search Loggly over the past 30 minutes to find your logs. It may take a few minutes to index them. If you don’t see them, check the troubleshooting section below.
Click on one of the Linux logs to show a list of syslog fields. If you don’t see them, please check that you are using one of our automatically parsed formats.
4. Next Steps
- Troubleshoot Problems Using Linux Logs – Find the root cause of login failures, memory problems, and more
- Logging from Applications – Send application logs through your Linux syslog daemon
Advanced Linux Logging Options
- Rsyslog TLS config – securely send sensitive data using TLS encryption
- Switch to UDP logging by using single “@” instead of “@@” in *.* @@logs-01.loggly.com:514;LogglyFormat line present in 22-loggly.conf file.
- The default maximum supported message size is 8K. Use $MaxMessageSize parameter in /etc/rsyslog.conf file to handle more than 8K message size.
- Systemd logs – send logs from linux distributions that have systemd or journald
- Scrub Sensitive Data – scrub private or secure data before it leaves your network
- Use Puppet to configure syslog on many nodes
- Streaming syslog
- Joyant or SmartOS Containers – the config file is stored in /opt/local/etc/rsyslog.conf
- Search or post your own Linux logs questions in the community forum.
Troubleshooting Linux Syslog
Sample Error Messages:
Package rsyslog-gnutls is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source
If you see this error then you must first update your package manager’s repository by running the below command:
sudo apt-get update
SELinux Error Message:
Sample Error Messages:
ERROR: selinux status is 'Enforcing'. Please manually restart the rsyslog daemon or turn off selinux by running 'setenforce 0' and then rerun the script.
If you see this error then you will need to disable the SELinux by setting it to permissive mode using the below command:
sudo setenforce 0
- Try manually configuring rsyslog if the script doesn’t work
- See our Rsyslog Troubleshooting Guide
- Check that you are using one of our automatically parsed formats
- Search or post your own question in the community forum.