diff --git a/examples/filter.pp b/examples/filter.pp new file mode 100644 index 0000000..0fa06ad --- /dev/null +++ b/examples/filter.pp @@ -0,0 +1,11 @@ +# configure filter +::fluentd::filter { 'test': + priority => 20, + pattern => '*.test', + config => { + 'type' => 'record_transformer', + 'record' => { + 'hostname' => '${hostname}' + } + } +} diff --git a/examples/init.pp b/examples/init.pp index c20b759..5a5354a 100644 --- a/examples/init.pp +++ b/examples/init.pp @@ -1,12 +1,2 @@ -# The baseline for module testing used by Puppet Labs is that each manifest -# should have a corresponding test manifest that declares that class or defined -# type. -# -# Tests are then run by using puppet apply --noop (to check for compilation -# errors and view a log of events) or by fully applying the test in a virtual -# environment (to compare the resulting system state to the desired state). -# -# Learn more about module testing here: -# http://docs.puppetlabs.com/guides/tests_smoke.html -# -include fluentd +# base installation and config +include '::fluentd' diff --git a/examples/match.pp b/examples/match.pp new file mode 100644 index 0000000..cafad04 --- /dev/null +++ b/examples/match.pp @@ -0,0 +1,16 @@ +# configure match +::fluentd::match { 'test': + priority => 30, + pattern => '*.test', + config => { + 'flush_interval' => '30s', + 'type' => 'secure_forward', + 'secure' => 'yes', + 'shared_key' => 'my_shared_key', + 'self_hostname' => 'instance.test.com', + 'ca_cert_path' => '/path/to/ca.cert', + 'servers' => { + 'host' => 'test.server.com' + } + } +} diff --git a/examples/plugin.pp b/examples/plugin.pp new file mode 100644 index 0000000..fdd2a1c --- /dev/null +++ b/examples/plugin.pp @@ -0,0 +1,9 @@ +# gem installation +::fluentd::plugin { 'fluent-plugin-elasticsearch': + type => 'gem' +} +# file installation +::fluentd::plugin { 'fluent-plugin-elasticsearch': + type => 'file', + source => 'puppet:///path/to/plugin' +} diff --git a/examples/source.pp b/examples/source.pp new file mode 100644 index 0000000..4488950 --- /dev/null +++ b/examples/source.pp @@ -0,0 +1,10 @@ +# configure source +::fluentd::source { 'test': + priority => 10, + config => { + 'type' => 'tail', + 'format' => 'json', + 'path' => '/var/log/test-application/*.json', + 'tag' => 'application.test' + } +}