Defined Type: rsyslog::rule::drop

Defined in:
manifests/rule/drop.pp

Overview

Add a rule to drop content

In general, the order will be:

  • Data Source Rules

  • Console Rules

  • Drop Rules

  • Remote Rules

  • Other/Miscellanious Rules

  • Local Rules

Examples:

Drop Logs Matching ^.bad_stuff.$

rsyslog::rule::drop { 'drop_bad_stuff':
  rule => 're_match($msg, '^.*bad_stuff.*$')'
}

Parameters:

  • name (String)

    The filename that you will be dropping into place

  • rule (String)

    The Rsyslog EXPRESSION to filter on

See Also:



31
32
33
34
35
36
37
38
39
# File 'manifests/rule/drop.pp', line 31

define rsyslog::rule::drop (
  String $rule
) {
  $_safe_name = regsubst($name,'/','__')

  rsyslog::rule { "07_simp_drop_rules/${_safe_name}.conf":
    content => inline_template('if (<%= @rule.split("\n").collect{ |x| x.sub(/^\s+/,"") }.join("\n") + ") then stop\n" %>')
  }
}