Load Balancing on Syslog-ng

When you want to send logs to specific logging servers at least two more to be load balancing, you can use Syslog-ng with the configuration as below. Deciding server where you send a log is depended on the last digit number of the system uptime. Here is a sample Syslog-ng configuration file for aforementioned the load balance.

filter f_0 {
   match("[0-9]*[02468]$" value("SYSUPTIME"));
};

filter f_1 {
      match("[0-9]*[13579]$" value("SYSUPTIME"));
};

log { source(s_fw); filter(f_0); destination(d_redis0); };
log { source(s_fw); filter(f_1); destination(d_redis1); };

 

Leave a comment

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