Defined Type: rsyslog::rule::other

Defined in:
manifests/rule/other.pp

Overview

Adds an arbitrary rule

The main reason to use this is to ensure proper ordering in the stack. If you want to insert a rule anywhere, use the $rsyslog::rule Defined Type

In general, the order will be:

  • Data Source Rules

  • Console Rules

  • Drop Rules

  • Remote Rules

  • Other/Miscellaneous Rules

  • Local Rules

fine: rsyslog::rule::other

Examples:

Send All local0 Messages to 1.2.3.4 via TCP

rsyslog::rule::other { 'send_local0_away':
  rule =>  "if prifilt('local0.*') then @@1.2.3.4"
}

Parameters:

  • name (Stdlib::Absolutepath)

    The filename that you will be dropping into place

  • rule (String)

    The Rsyslog EXPRESSION to filter on

See Also:



35
36
37
38
39
40
41
42
43
# File 'manifests/rule/other.pp', line 35

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

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