Documentation forSolarWinds Observability SaaS

Send logs using syslog from a Linux machine (Papertrail)

Using a syslog daemon such as rsyslog, you can collect application, operating system, and other log files on your device and forward those logs to SolarWinds Observability SaaS. Linux devices typically come with rsyslog built in.

Papertrail only allows TLS-encrypted connections. Make sure that your firewall permits TCP/HTTPS/TLS outbound connections to syslog.collector.xx-yy.cloud.solarwinds.com (where xx-yy is determined by the URL you use to access Papertrail, described in Data centers and endpoint URIs.

From a Linux machine

  1. In Papertrail, click Setup logging at the top.
  2. Use one of your existing destinations, or create a new destination and click Start logging.

  3. Select the Syslog button, and then select your Linux distribution from the Operating system drop-down.

  4. Click Easy to follow a simple, script-based method, or click Manual to install certificates and configure rsyslog.

  5. For the Easy, script-based method, see Easy method below. For the full instructions to install the certificate and configure rsyslog, see Manual method.

  6. Click View Logs to open the Logs Explorer and view the logs forwarded with syslog.

Collect a specific application log file with imfile

After completing either the Easy or Manual setup to send logs from a Linux machine using syslog, you can collect a specific application log file with imfile. These instructions apply to both Easy and Manual setups and reuse the existing TLS and SWOFormat configuration.

To collect a single file with imfile, run the following script:

module(load="imfile")

input(
  type="imfile"
  File="/opt/myapp/logs/application.log"
  Tag="myapp:"
  Facility="local0"
  Severity="info"
  PersistStateInterval="100"
)

This example assigns every file the same myapp: tag and does not include the actual file name.

To collect multiple files with imfile, run the following script:

input(
  type="imfile"
  File="/opt/myapp/logs/*.log"
  Tag="myapp:"
  Facility="local0"
  Severity="info"
  PersistStateInterval="100"
)

This example assigns every file the same myapp: tag and does not include the actual file name.

The existing rule forwards the collected messages:

*.* @@YourSyslogEndpoint:6514;SWOFormat

To forward only the application file messages, replace the existing rule with the following:

local0.* @@YourSyslogEndpoint:6514;SWOFormat

Do not keep both rules, as messages may be sent twice.

Make sure the rsyslog service can read the application log file and its parent directories, then validate and restart rsyslog:

sudo rsyslogd -N1
sudo service rsyslog restart

Test the setup by adding a line to the file and verifying that it appears in the Logs Explorer.

The scripts are not supported under any SolarWinds support program or service. The scripts are provided AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The risk arising out of the use or performance of the scripts and documentation stays with you. In no event shall SolarWinds or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the scripts or documentation.