Defined Type: logstash::patternfile

Defined in:
manifests/patternfile.pp

Overview

This type represents a Grok pattern file for Logstash.

Examples:

Define a pattern file.

logstash::patternfile { 'mypattern':
  source => 'puppet:///path/to/my/custom/pattern'
}

Define a pattern file with an explicit destination filename.

logstash::patternfile { 'mypattern':
  source   => 'puppet:///path/to/my/custom/pattern',
  filename => 'custom-pattern-name'
}

Parameters:

  • source (Pattern[/^(puppet|file):\/\//]) (defaults to: undef)

    File source for the pattern file. eg. ‘puppet://` or `file://`

  • filename (Optional[String[1]]) (defaults to: undef)

    Optionally set the destination filename.

Author:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'manifests/patternfile.pp', line 22

define logstash::patternfile (
  Pattern[/^(puppet|file):\/\//] $source   = undef,
  Optional[String[1]]            $filename = undef,
) {
  require logstash::config

  $destination = pick($filename, basename($source))

  file { "${logstash::config_dir}/patterns/${destination}":
    ensure => file,
    source => $source,
    owner  => 'root',
    group  => $logstash::logstash_group,
    mode   => '0640',
    tag    => ['logstash_config'],
  }
}