platforms / syslog / installation

Syslog Installation

The instructions below are for rsyslog v8 which is distributed with most Linux systems. Before proceeding, we expect that you have already set up your application to forward logs to the syslog server. You will need to know the program name your logs are tagged with. For this example, we'll assume the program name is myapp.

  1. Download the archive for your architecture:

    1
     curl -LO {{choose-url-below}}
    

    Darwin AMD64 latest, FreeBSD AMD64 latest, Linux AMD64 latest, NetBSD AMD64 latest, or OpenBSD AMD64 latest

  2. Unpack the archive to a common location like /opt:

    1
     tar -xzf timber-agent-0.x.x-darwin-amd64.tar.gz0 -C /opt
    
  3. Add a new configuration file to /etc/rsyslog.d. For this example, we'll use the filename /etc/syslog.d/myapp.conf. The contents should be as follows (make sure to replace {{my-tiber-api-key}} with your API key and myapp with your program name tag):

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
     module(load="omprog")
     template(name="TimberForward" type="list") {
       constant(value="<")
       property(name="pri")
       constant(value=">")
       property(name="timestamp" dateFormat="rfc3339")
       constant(value=" ")
       property(name="hostname")
       constant(value=" ")
       property(name="syslogtag" position.from="1" position.to="32")
       property(name="msg" spifno1stsp="on" )
       property(name="msg")
       constant(value="\n")
     }
     if $programname == 'myapp' then action(type="omprog"
       binary="/opt/timber-agent/bin/timber-agent capture-stdin --api-key={{my-timber-api-key}}"
         template="TimberForward"
         signalOnClose="on"
     )
    
  4. Restart the rsyslog service:

    1
     systemctl restart rsyslog
    
Questions?

Chat with us, just click the talk button in the bottom right of this page.

Chat with us
Sign Up

Log better and solve problems faster, today. Install in under a minute.

Sign Up