Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch-issue-298 - use separate queues for each remote server #302

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions templates/client/config.conf.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# An "In-Memory Queue" is created for remote logging.
$WorkDirectory <%= scope.lookupvar('rsyslog::spool_dir') -%> # where to place spool files
$ActionQueueFileName queue # unique name prefix for spool files
$ActionQueueMaxDiskSpace <%= scope.lookupvar('rsyslog::client::spool_size') -%> # spool space limit (use as much as possible)
$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
<% if scope.lookupvar('rsyslog::client::spool_timeoutenqueue') -%>
$ActionQueueTimeoutEnqueue <%= scope.lookupvar('rsyslog::client::spool_timeoutenqueue') -%> # time to wait before discarding on full spool
<% end -%>
$ActionQueueType LinkedList # run asynchronously
$ActionResumeRetryCount -1 # infinety retries if host is down
<% if scope.lookupvar('rsyslog::client::log_templates') and ! scope.lookupvar('rsyslog::client::log_templates').empty?-%>

# Set working directory
$WorkDirectory <%= scope.lookupvar('rsyslog::spool_dir') -%>
<% if scope.lookupvar('rsyslog::client::log_templates') and ! scope.lookupvar('rsyslog::client::log_templates').empty?-%>
# Define custom logging templates
<% scope.lookupvar('rsyslog::client::log_templates').flatten.compact.each do |log_template| -%>
$template <%= log_template['name'] %>,"<%= log_template['template'] %>"
Expand Down
18 changes: 17 additions & 1 deletion templates/client/remote.conf.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if scope.lookupvar('rsyslog::client::remote_servers') -%>
<% scope.lookupvar('rsyslog::client::remote_servers').flatten.compact.each do |server| -%>
<% scope.lookupvar('rsyslog::client::remote_servers').flatten.compact.each_with_index do |server, index| -%>
<% if server['pattern'] and server['pattern'] != ''-%>
<% pattern = server['pattern'] -%>
<% else -%>
Expand Down Expand Up @@ -44,12 +44,28 @@
<% dropaction = '' -%>
<% end -%>
# Sending logs that match <%= pattern %> to <%= host %> via <%= protocol_type %> on <%= port %> using <%=format_type %> format.
$ActionQueueFileName queue.<%= index %> # unique name prefix for spool files
$ActionQueueMaxDiskSpace <%= scope.lookupvar('rsyslog::client::spool_size') -%> # spool space limit (use as much as possible)
$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
<% if scope.lookupvar('rsyslog::client::spool_timeoutenqueue') -%>
$ActionQueueTimeoutEnqueue <%= scope.lookupvar('rsyslog::client::spool_timeoutenqueue') -%> # time to wait before discarding on full spool
<% end -%>
$ActionQueueType LinkedList # run asynchronously
$ActionResumeRetryCount -1 # infinety retries if host is down
<%= pattern %> <%= protocol %><%= host %>:<%= port %><%= format %>
<%= dropaction %>
<% end -%>
<% elsif scope.lookupvar('rsyslog::client::log_remote') -%>

# Log to remote syslog server using <%= scope.lookupvar('rsyslog::client::remote_type') %>
$ActionQueueFileName queue # unique name prefix for spool files
$ActionQueueMaxDiskSpace <%= scope.lookupvar('rsyslog::client::spool_size') -%> # spool space limit (use as much as possible)
$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
<% if scope.lookupvar('rsyslog::client::spool_timeoutenqueue') -%>
$ActionQueueTimeoutEnqueue <%= scope.lookupvar('rsyslog::client::spool_timeoutenqueue') -%> # time to wait before discarding on full spool
<% end -%>
$ActionQueueType LinkedList # run asynchronously
$ActionResumeRetryCount -1 # infinety retries if host is down
<% if scope.lookupvar('rsyslog::client::remote_type') == 'tcp' -%>
*.* @@<%= scope.lookupvar('rsyslog::client::server') -%>:<%= scope.lookupvar('rsyslog::client::port') -%>;<%= scope.lookupvar('rsyslog::client::remote_forward_format') -%>
<% else -%>
Expand Down