How to Configure Rsyslog in Linux for sending Linux Systems Logs to Loggly
Posted By : Sanjay Saini | 08-Aug-2014
Hello Friends,
In this blog ,I am going to explain you how to configure rsyslog in Linux systems for sending logs to Loggly.
In common linux distribution with rsyslog 1.19 , rsyslog receives your system logs, and port 514 is open for connection that departing your data to another destination.
Steps need to follow for Configuration
Step-1 : First we need to update rsyslog configuration files ,open your rsyslog.conf file in vim editor in insert mode.
Mostly its found on /etc/ directory.
command for open file in vim editor sudo vim /etc/rsyslog.conf
Press i to go insert mode and copy paste below code inside the file under the GLOBAL DIRECTIVES
$template LogglyFormat,"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [TOKEN@41058 tag=\"TAG\"] %msg%\n" *.* @@logs-01.loggly.com:514;LogglyFormat
Replace Following variable
TAG : Replace with a tag that describes the syslog source.
TOKEN : TOKEN replace with your customer token (token provided by loggly after loggly account has been created)
After replacing the variables, Press ESC or Ctrl+c to out from insert mode.
Command for save your changes
:wq type this and enter for exiting vim editor after saving your Changes.
Step 2: Restart Rsyslog service.
command for restart rsyslog sudo service rsyslog restart.
Step 3 : Verify the logs on Loggly.
Wait 5-10 minutes after setup .For verifiy logs on Loggly .Type "tag:your tag name" on searchbox and search logs received in last 10 minutes.
Hope it is useful for you :)
Thank you
Sanjay Saini
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Sanjay Saini
Sanjay has been working on web application development using frameworks like Java, groovy and grails. He loves listening to music , playing games and going out with friends in free time.