From e047376599593a87afa4077492e2e5aa9a17d6b1 Mon Sep 17 00:00:00 2001 From: Michael LoSapio Date: Mon, 13 Mar 2017 09:02:05 -0700 Subject: [PATCH] Updated to include custom catchall --- README.md | 4 +++- manifests/client.pp | 2 ++ templates/client/local.conf.erb | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b3a380..2dcf1ee 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ or send some bitcoins to ```1Na3YFUmdxKxJLiuRXQYJU2kiNqA3KY2j9``` actionfiletemplate_cust => false, actionfiletemplate => false, high_precision_timestamps => false, + custom_catchall => false, rate_limit_burst => undef, rate_limit_interval => undef, imfiles => undef @@ -75,7 +76,7 @@ Gathers log information from a file ``` #### rsyslog.d conf files -e.g. rsyslog.d/10-puppetagent.conf - moves puppet-agent entries to a file and excludes from /var/log/messages +e.g. rsyslog.d/10-puppetagent.conf - moves puppet-agent entries to a file and excludes from /var/log/messages ``` rsyslog::snippet { '10-puppetagent': content => ":programname,contains,\"puppet-agent\" /var/log/puppetlabs/puppet/puppet-agent.log\n& ~", @@ -270,6 +271,7 @@ The following lists all the class parameters this module accepts. actionfiletemplate_cust STRING If set this defines the `ActionFileDefaultTemplate custom formatting` which sets customisations over the default log format for remote and local logging. Must be used with actionfiletemplate to take effect. Defaults to false. actionfiletemplate STRING If set this defines the `ActionFileDefaultTemplate` which sets the default logging format for remote and local logging. high_precision_timestamps true,false Whether or not to use high precision timestamps. + custom_catchall STRING Custom rule for the distro-default catchall rule. Defaults to distro-default. RSYSLOG::DATABASE CLASS PARAMETERS VALUES DESCRIPTION ------------------------------------------------------------------- diff --git a/manifests/client.pp b/manifests/client.pp index e045adc..1f2e178 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -30,6 +30,7 @@ # [*actionfiletemplate_cust*] # [*actionfiletemplate*] # [*high_precision_timestamps*] +# [*custom_catchall*] # [*imfiles*] # # === Variables @@ -66,6 +67,7 @@ $actionfiletemplate_cust = false, $actionfiletemplate = false, $high_precision_timestamps = false, + $custom_catchall = false, $imfiles = undef ) inherits rsyslog::params { include ::rsyslog diff --git a/templates/client/local.conf.erb b/templates/client/local.conf.erb index a7458a9..1e1dd42 100644 --- a/templates/client/local.conf.erb +++ b/templates/client/local.conf.erb @@ -42,6 +42,9 @@ news.notice -/var/log/news/news.notice # # Some "catch-all" log files. # +<% if @custom_catchall -%> +<%= @custom_catchall -%> +<% else -%> *.=debug;\ auth,authpriv.none;\ news.none;mail.none -/var/log/debug @@ -49,6 +52,7 @@ news.notice -/var/log/news/news.notice auth,authpriv.none;\ cron,daemon.none;\ mail,news.none -/var/log/messages +<%- end -%> # # I like to have messages displayed on the console, but only on a virtual @@ -80,7 +84,11 @@ daemon.*;mail.*;\ # Log anything (except mail) of level info or higher. # Don't log private authentication messages! +<% if @custom_catchall -%> +<%= @custom_catchall -%> +<% else -%> *.info;mail.none;authpriv.none;cron.none /var/log/messages +<%- end -%> # Log all the mail messages in one place. mail.* -/var/log/maillog