<% @path = "/etc/rsyslog.d/1-graylog.conf" @post = "/usr/sbin/service rsyslog restart" graylog_server = rubber_instances.for_role("graylog_server").first is_graylog_instance = rubber_instance.role_names.include?('graylog_server') %> <% if graylog_server %> # start forwarding rule - we want logs to buffer up if # remote log collector not available $ActionQueueType LinkedList $ActionQueueFileName graylog-buffer $ActionQueueMaxDiskSpace 1g $ActionResumeRetryCount -1 $ActionQueueSaveOnShutdown on # the graylog instance's rsyslog collects all syslog in local syslog daemon and # then forwards it on to local graylog daemon <% if is_graylog_instance %> *.* @<%= graylog_server.full_name %>:<%= rubber_env.graylog_server_syslog_port %> <% else %> *.* @<%= graylog_server.full_name %>:514 <% end %> # end forwarding rule 1 <% end %>