# Generated by Chef
$ActionQueueType LinkedList # use asynchronous processing
$ActionQueueFileName srvrfwd # set file name, also enables disk mode
$ActionResumeRetryCount -1 # infinite retries on insert failure
$ActionQueueSaveOnShutdown on # save in-memory data if rsyslog shuts down
$ActionQueueMaxDiskSpace <%= node['rsyslog']['action_queue_max_disk_space'] %> # Don't use more than this much space for the queue
<% if node['rsyslog']['enable_tls'] && node['rsyslog']['tls_ca_file'] -%>
$DefaultNetstreamDriverCAFile <%= node['rsyslog']['tls_ca_file'] %>
<%   if node['rsyslog']['tls_certificate_file'] -%>
$DefaultNetstreamDriverCertFile <%= node['rsyslog']['tls_certificate_file'] %>
<%   end -%>
<%   if node['rsyslog']['tls_key_file'] -%>
$DefaultNetstreamDriverKeyFile <%= node['rsyslog']['tls_key_file'] %>
<%   end -%>

$DefaultNetstreamDriver gtls
$ActionSendStreamDriverMode 1
$ActionSendStreamDriverAuthMode <%= node['rsyslog']['tls_auth_mode'] %>
<% end -%>

<% @servers.each do |server| -%>
<%   case node['rsyslog']['protocol'] -%>
<%   when "tcp" -%>
<%= node['rsyslog']['logs_to_forward'] %> @@<%= server %>:<%= node['rsyslog']['port'] %><%= node["rsyslog"]["default_remote_template"] ? ';' + node["rsyslog"]["default_remote_template"] : nil %>
<%   when "udp" -%>
<%= node['rsyslog']['logs_to_forward'] %> @<%= server %>:<%= node['rsyslog']['port'] %><%= node["rsyslog"]["default_remote_template"] ? ';' + node["rsyslog"]["default_remote_template"] : nil %>
<%   end -%>
<% end -%>
