--- patternfile.pp 2019-01-09 15:23:12.000000000 -0600 +++ /tmp/3 2019-01-09 15:05:52.000000000 -0600 @@ -11,6 +11,10 @@ # source => 'puppet:///path/to/my/custom/pattern' # } # +# logstash::patternfile { 'anotherpattern': +# content => file('path/to/my/custom/anotherpattern') +# } +# # @example Define a pattern file with an explicit destination filename. # logstash::patternfile { 'mypattern': # source => 'puppet:///path/to/my/custom/pattern', @@ -20,11 +24,14 @@ # @author https://github.com/elastic/puppet-logstash/graphs/contributors # define logstash::patternfile ( + Optional[String[1]] $content = undef, Pattern[/^(puppet|file):\/\//] $source = undef, Optional[String[1]] $filename = undef, ) { require logstash::config + if($content) { $source = $content } + $destination = pick($filename, basename($source)) file { "${logstash::config_dir}/patterns/${destination}":