Commit 9e796ea5 authored by Peter Fern's avatar Peter Fern Committed by Sean OMeara
Browse files

[COOK-4021] Allow specifying default templates for local and remote


Signed-off-by: default avatarSean OMeara <someara@opscode.com>
parent 964a0662
......@@ -42,6 +42,8 @@ See `attributes/default.rb` for default values.
* `node['rsyslog']['logs_to_forward']` - Specifies what logs should be sent to the remote rsyslog server. Default is all ( \*.\* ).
* `node['rsyslog']['default_log_dir']` - log directory used in `50-default.conf` template, defaults to `/var/log`
* `node['rsyslog']['default_facility_logs']` - Hash containing log facilities and destinations used in `50-default.conf` template.
* `node['rsyslog']['default_facility_logs']` - Hash containing log facilities and destinations used in 50-default.conf template.
* `node['rsyslog']['default_file_template']` - The name of a pre-defined log format template (ie - RSYSLOG_FileFormat), used for local log files.
* `node['rsyslog']['rate_limit_interval']` - Value of the $SystemLogRateLimitInterval configuration directive in `/etc/rsyslog.conf`. Default is nil, leaving it to the platform default.
* `node['rsyslog']['rate_limit_burst']` - Value of the $SystemLogRateLimitBurst configuration directive in `/etc/rsyslog.conf`. Default is nil, leaving it to the platform default.
* `node['rsyslog']['enable_tls']` - Whether or not to enable TLS encryption. When enabled, forces protocol to `tcp`. Default is `false`.
......
......@@ -34,6 +34,8 @@ default['rsyslog']['repeated_msg_reduction'] = 'on'
default['rsyslog']['logs_to_forward'] = '*.*'
default['rsyslog']['enable_imklog'] = true
default['rsyslog']['config_prefix'] = '/etc'
default['rsyslog']['default_file_template'] = nil
default['rsyslog']['default_remote_template'] = nil
default['rsyslog']['rate_limit_interval'] = nil
default['rsyslog']['rate_limit_burst'] = nil
default['rsyslog']['enable_tls'] = false
......
......@@ -88,6 +88,14 @@ attribute 'rsyslog/priv_seperation',
:description => 'Whether or not to make use of Rsyslog privilege separation',
:default => 'false'
attribute 'rsyslog/default_file_template',
:display_name => 'Default file log format template',
:description => 'The name of a pre-defined log format template (ie - `RSYSLOG_FileFormat`), used for local log files.'
attribute 'rsyslog/default_remote_template',
:display_name => 'Default remote log format template',
:description => 'The name of a pre-defined log format template (ie - `RSYSLOG_SyslogProtocol23Format`), used for remote log forwarding.'
attribute 'rsyslog/enable_tls',
:display_name => 'Enable TLS',
:description => 'Whether or not to enable TLS encryption. When enabled, forces protocol to "tcp"',
......
......@@ -20,8 +20,8 @@ $ActionSendStreamDriverAuthMode <%= node['rsyslog']['tls_auth_mode'] %>
<% @servers.each do |server| -%>
<% case node['rsyslog']['protocol'] -%>
<% when "tcp" -%>
<%= node['rsyslog']['logs_to_forward'] %> @@<%= server %>:<%= node['rsyslog']['port'] %>
<%= 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']['logs_to_forward'] %> @<%= server %>:<%= node['rsyslog']['port'] %><%= node["rsyslog"]["default_remote_template"] ? ';' + node["rsyslog"]["default_remote_template"] : nil %>
<% end -%>
<% end -%>
......@@ -54,6 +54,12 @@ $UDPServerRun <%= node['rsyslog']['port'] %>
###########################
<% unless node["rsyslog"]["high_precision_timestamps"] -%>
<% if node["rsyslog"]["default_file_template"] -%>
#
# Default log format template
#
$ActionFileDefaultTemplate <%= node["rsyslog"]["default_file_template"] %>
<% elsif !node["rsyslog"]["high_precision_timestamps"] -%>
#
# Use default timestamp format.
# To enable high precision timestamps, comment out the following line.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment