From bd49c724c276f8fe5c322fcd1cc8ad3a53265404 Mon Sep 17 00:00:00 2001 From: Michael Stathers Date: Tue, 23 Jun 2020 11:14:33 -0700 Subject: [PATCH 1/2] typo on --- templates/td-agent-bit.conf.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/td-agent-bit.conf.erb b/templates/td-agent-bit.conf.erb index 974b4a1..2c54fcc 100644 --- a/templates/td-agent-bit.conf.erb +++ b/templates/td-agent-bit.conf.erb @@ -11,7 +11,7 @@ <% end -%> Log_Level <%= @log_level %> Parsers_File <%= @parsers_file %> - Plugin_File <%= @plugins_file %> + Plugins_File <%= @plugins_file %> Streams_file <%= @streams_file %> HTTP_Server <%= @http_server %> HTTP_Listen <%= @http_listen %> From 63ae118e40aaa626fa8cf5b9508a13fca9fdce38 Mon Sep 17 00:00:00 2001 From: Michael Stathers Date: Tue, 23 Jun 2020 11:53:51 -0700 Subject: [PATCH 2/2] create newrelic plugin --- manifests/output/newrelic.pp | 29 ++++++++++++++++++++++++ templates/output/newrelic.conf.erb | 36 ++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 manifests/output/newrelic.pp create mode 100644 templates/output/newrelic.conf.erb diff --git a/manifests/output/newrelic.pp b/manifests/output/newrelic.pp new file mode 100644 index 0000000..b11bdc4 --- /dev/null +++ b/manifests/output/newrelic.pp @@ -0,0 +1,29 @@ +# @summary Plugin to output logs to newrelic +# +# https://github.com/newrelic/newrelic-fluent-bit-output +# +# @example +# fluentbit::output::newrelic { 'newrelic': } +define fluentbit::output::newrelic ( + Stdlib::Absolutepath + $configfile = "/etc/td-agent-bit/output_newrelic_${name}.conf", + String $match = '*', + String $licenseKey = undef, + Optional[String] $apiKey = undef, + Optional[Stdlib::HTTPUrl] $endpoint = undef, + Optional[Integer[1]] $maxBufferSize = undef, + Optional[Integer[1]] $maxRecords = undef, + Optional[String] $proxy = undef, + Optional[Enum['true', 'false']] $ignoreSystemProxy = undef, + Optional[Stdlib::Absolutepath] $caBundleFile = undef, + Optional[Stdlib::Absolutepath] $caBundleDir = undef, + Optional[Enum['true', 'false']] $validateProxyCerts = undef, +) { + file { $configfile: + ensure => file, + mode => $fluentbit::config_file_mode, + content => template('fluentbit/output/newrelic.conf.erb'), + notify => Class['fluentbit::service'], + require => Class['fluentbit::install'], + } +} diff --git a/templates/output/newrelic.conf.erb b/templates/output/newrelic.conf.erb new file mode 100644 index 0000000..538a1c8 --- /dev/null +++ b/templates/output/newrelic.conf.erb @@ -0,0 +1,36 @@ +# Managed by puppet +[OUTPUT] + Name newrelic +<%- if @match -%> + Match <%= @match %> +<% end -%> +<%- if @licenseKey -%> + licenseKey <%= @licenseKey %> +<% end -%> +<%- if @maxBufferSize -%> + maxBufferSize <%= @maxBufferSize %> +<% end -%> +<%- if @maxRecords -%> + maxRecords <%= @maxRecords %> +<% end -%> +<%- if @endpoint -%> + endpoint <%= @endpoint %> +<% end -%> +<%- if @apiKey -%> + apiKey <%= @apiKey %> +<% end -%> +<%- if @proxy -%> + proxy <%= @proxy %> +<% end -%> +<%- if @ignoreSystemProxy -%> + ignoreSystemProxy <%= @ignoreSystemProxy %> +<% end -%> +<%- if @caBundleFile -%> + caBundleFile <%= @caBundleFile %> +<% end -%> +<%- if @caBundleDir -%> + caBundleDir <%= @caBundleDir %> +<% end -%> +<%- if @validateProxyCerts -%> + validateProxyCerts <%= @validateProxyCerts %> +<% end -%>