These days I’m working with a small script written in Perl to send log files to a remote syslog server. The motivation to develop this script was principally to learning more about Perl and the needed to send log files to a remote server, and I decide to upload to github under GPLv3 for anyone who wants to use or extend his functionality.

syslog-ng

Basically rloggerd has two ways of work:

  • Simply mode send a log file to the remote server and the remote syslog server manage the lines of the files sent with their facility and priority:
./rloggerd.pl --server 192.168.1.136 --file /var/log/mysqld.log --facility local1 --priority info
  • Daemon mode, it may be very useful to send permanently to the syslog server the messages from a log file executing rloggerd with the option –daemon. This mode sends the new lines since rloggerd was invoked to send continuously the new log entries to the syslog server:
./rloggerd.pl --server 192.168.1.136 --file /var/log/mysqld.log --facility local0 --priority warn --socket tcp --tag "hello world" --daemon

With –help option show a menu help with mandatory options and other optional like the type of socket to use or the tag of log messages. Actually rloggerd can do few options, but I’m thinking to implement more useful functionality to improve this script and of course keep learning!! You can found the source code in github with the next link:
https://github.com/opentodonet/rloggerd.git

If you have any suggestion or find any problem with the script please contact with me!

Sending log files to remote syslog server with rloggerd
Tagged on:         

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow

Get every new post delivered to your Inbox

Join other followers: