How do I setup rsyslog to send all logs to multiple remote servers?
I am trying to make rsyslog to send all logs to 2 remote servers, but it seems rsyslog only sends to the secondary server if the first one fails.
*.* @@server1
*.* @@server2
If I put the above in /etc/rsyslog.conf, server2 will not receive any logs as long as server1 is up. How do I tell rsyslog to send to both servers no matter what?
Also, as an extra bonus, I would like to use 2 different local "buffer"-files for local storing if the remote servers goes down.
From Forwarding to More than One Server;
What is important to know, however, is that the full set of directives make up an action. So you can not simply add (just) a second forwarding rule, but need to duplicate the rule configuration as well. Be careful that you use different queue file names for the second action, else you will mess up your system.
So, actually, you have to use 2 different local queues.
Configure a working directory.
$WorkDirectory /var/spool/rsyslog
Configure your forwarding rules.
$ActionQueueType LinkedList
$ActionQueueFileName Forward1
$ActionResumeRetryCount -1
$ActionQueueSaveOnShutdown on
*.* @@server1
$ActionQueueType LinkedList
$ActionQueueFileName Forward2
$ActionResumeRetryCount -1
$ActionQueueSaveOnShutdown on
*.* @@server2