1
0
mirror of https://github.com/krislamo/puppet-fluentd synced 2025-09-13 08:59:29 +00:00

5 Commits
1.0.0 ... 1.0.1

Author SHA1 Message Date
Andy Pritchard
540ef4e40d Update metadata.json 2018-03-05 10:52:15 +00:00
Andy Pritchard
d92ea1e849 Updated README.md 2018-03-05 10:50:03 +00:00
Andy Pritchard
59fb7919a2 Merge pull request #1 from pilchkinstein-gtv/source_parse_storage
Implemented <parse>, <storage> etc sections within fluentd::source template
2018-03-05 09:13:34 +00:00
pilchkinstein-gtv
29122932ef Fixed lint warnings 2018-03-02 23:22:13 +00:00
pilchkinstein-gtv
72e6bcd744 Implemented <parse>, <storage> etc sections within fluentd::source template
- Changed templates/source.erb to accept Hash elements within 'config'
- Updated source_spec test
- Updated README.md
2018-03-02 22:32:51 +00:00
6 changed files with 59 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
# wywy/fluentd Puppet Module # pilchkinstein-gtv/fluentd Puppet Module
[![GitHub version](https://badge.fury.io/gh/wywy%2Fpuppet-fluentd.svg)](https://github.com/wywy/puppet-fluentd) [![GitHub version](https://badge.fury.io/gh/wywy%2Fpuppet-fluentd.svg)](https://github.com/pilchkinstein-gtv/puppet-fluentd)
[![Build Status](https://travis-ci.org/wywy/puppet-fluentd.svg?branch=master)](https://travis-ci.org/wywy/puppet-fluentd) [![Build Status](https://travis-ci.org/wywy/puppet-fluentd.svg?branch=master)](https://travis-ci.org/wywy/puppet-fluentd)
@@ -131,6 +131,14 @@ include '::fluentd'
'type' => 'tail', 'type' => 'tail',
'format' => 'json', 'format' => 'json',
'path' => '/var/log/test-application/*.json', 'path' => '/var/log/test-application/*.json',
'parse' => {
'type' => 'regexp',
'expression' => '^(?<name>[^ ]*) (?<user>[^ ]*) (?<age>\d*)$'
},
'storage'=> {
'type' => 'local',
'path' => 'test.pos'
},
'tag' => 'application.test' 'tag' => 'application.test'
} }
} }
@@ -142,6 +150,14 @@ include '::fluentd'
type tail type tail
format json format json
path /var/log/test-application/*.json path /var/log/test-application/*.json
<parse>
type regexp
expression ^(?<name>[^ ]*) (?<user>[^ ]*) (?<age>\d*)$
</parse>
<storage>
type local
path test.pos
</storage>
tag application.test tag application.test
</source> </source>
``` ```

View File

@@ -2,9 +2,17 @@
::fluentd::source { 'test': ::fluentd::source { 'test':
priority => 10, priority => 10,
config => { config => {
'type' => 'tail', 'type' => 'tail',
'format' => 'json', 'format' => 'json',
'path' => '/var/log/test-application/*.json', 'path' => '/var/log/test-application/*.json',
'tag' => 'application.test' 'parse' => {
'type' => 'regexp',
'expression' => '^(?<name>[^ ]*) (?<user>[^ ]*) (?<age>\d*)$'
},
'storage' => {
'type' => 'local',
'path' => 'test.pos'
},
'tag' => 'application.test'
} }
} }

View File

@@ -1,12 +1,12 @@
{ {
"name": "wycore-fluentd", "name": "pilchkinstein-fluentd",
"version": "1.0.0", "version": "1.0.0",
"author": "wywy", "author": "pilchkinstein-gtv",
"summary": "Generic module for fluentd (td-agent).", "summary": "Generic module for fluentd (td-agent).",
"license": "Apache-2.0", "license": "Apache-2.0",
"source": "https://github.com/wycore/puppet-fluentd", "source": "https://github.com/pilchkinstein-gtv/puppet-fluentd",
"project_page": "https://github.com/wycore/puppet-fluentd", "project_page": "https://github.com/pilchkinstein-gtv/puppet-fluentd",
"issues_url": "https://github.com/wycore/puppet-fluentd/issues", "issues_url": "https://github.com/pilchkinstein-gtv/puppet-fluentd/issues",
"tags": ["fluentd", "td-agent"], "tags": ["fluentd", "td-agent"],
"operatingsystem_support": [ "operatingsystem_support": [
{ {

View File

@@ -18,6 +18,14 @@ describe 'fluentd::source' do
'type' => 'tail', 'type' => 'tail',
'format' => 'json', 'format' => 'json',
'path' => '/var/log/test-application/*.json', 'path' => '/var/log/test-application/*.json',
'parse' => {
'type' => 'regexp',
'expression' => '^(?<name>[^ ]*) (?<user>[^ ]*) (?<age>\d*)$'
},
'storage'=> {
'type' => 'local',
'path' => 'test.pos'
},
'tag' => 'application.test' 'tag' => 'application.test'
} }
} }

View File

@@ -2,5 +2,13 @@
type tail type tail
format json format json
path /var/log/test-application/*.json path /var/log/test-application/*.json
<parse>
type regexp
expression ^(?<name>[^ ]*) (?<user>[^ ]*) (?<age>\d*)$
</parse>
<storage>
type local
path test.pos
</storage>
tag application.test tag application.test
</source> </source>

View File

@@ -1,5 +1,13 @@
<source> <source>
<% @config.each do |key, val| -%> <% @config.each do |key, val| -%>
<%- if val.is_a?( Hash ) -%>
<<%= key -%>>
<%- val.each do |key2, val2| -%>
<%= key2 -%> <%= val2 %>
<%- end -%>
</<%= key %>>
<%- else -%>
<%= key -%> <%= val %> <%= key -%> <%= val %>
<%- end -%>
<% end -%> <% end -%>
</source> </source>