fluent-plugin-buffered-stdout 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +13 -0
- data/README.md +24 -0
- data/Rakefile +1 -0
- data/fluent-plugin-buffered-stdout.gemspec +21 -0
- data/lib/fluent/plugin/out_buffered_stdout.rb +34 -0
- metadata +95 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a4f1cfed4d65733a22c1724f913d2908cccba160
|
4
|
+
data.tar.gz: e8e3a855c629a9e387f3cb0e9853ef7cf30efff3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 343d37ac6c27f72cfc02aba0a80c3528c8b6fadc94f2226925cd796f297f0bfa29ff65b2e3fe7b941389b1db10eecefcd789a3663097cbc0162fd54ee2e3951a
|
7
|
+
data.tar.gz: eaa804008c577faf2c13f58e9687fa5cda1f5af4432281cbbef8cbc441c6b75923bbbf1a006506a6db7c8524e062ab1b6b5ab281887512d90cd4d77e3ddf7c84
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright (c) 2012- TAGOMORI Satoshi
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# fluent-plugin-buffered-stdout
|
2
|
+
|
3
|
+
Fluentd STDOUT output plugin with buffering. This plugin is for testing of buffer plugins only.
|
4
|
+
|
5
|
+
## Configuration
|
6
|
+
|
7
|
+
Same with `out_stdout` with buffering options.
|
8
|
+
|
9
|
+
```
|
10
|
+
<match data.**>
|
11
|
+
type buffered_stdout
|
12
|
+
output_type json # default
|
13
|
+
|
14
|
+
# buffering options
|
15
|
+
buffer_type memory # default
|
16
|
+
flush_interval 10s
|
17
|
+
</match>
|
18
|
+
```
|
19
|
+
|
20
|
+
## Copyright
|
21
|
+
|
22
|
+
* Copyright (c) 2013- TAGOMORI Satoshi (tagomoris)
|
23
|
+
* License
|
24
|
+
* Apache License, Version 2.0
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "fluent-plugin-buffered-stdout"
|
5
|
+
spec.version = "0.0.1"
|
6
|
+
spec.authors = ["TAGOMORI Satoshi"]
|
7
|
+
spec.email = ["tagomoris@gmail.com"]
|
8
|
+
spec.description = %q{Fluentd STDOUT output plugin with buffering, for buffer plugin tests only}
|
9
|
+
spec.summary = %q{Buffered stdout output plugin for Fluentd}
|
10
|
+
spec.homepage = "https://github.com/tagomoris/fluent-plugin-buffered-stdout"
|
11
|
+
spec.license = "APLv2"
|
12
|
+
|
13
|
+
spec.files = `git ls-files`.split($/)
|
14
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
15
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
16
|
+
spec.require_paths = ["lib"]
|
17
|
+
|
18
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
19
|
+
spec.add_development_dependency "rake"
|
20
|
+
spec.add_runtime_dependency "fluentd"
|
21
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Fluent
|
2
|
+
class BufferedStdoutOutput < ObjectBufferedOutput
|
3
|
+
Fluent::Plugin.register_output('buffered_stdout', self)
|
4
|
+
|
5
|
+
OUTPUT_PROCS = {
|
6
|
+
:json => Proc.new {|record| Yajl.dump(record) },
|
7
|
+
:hash => Proc.new {|record| record.to_s },
|
8
|
+
}
|
9
|
+
|
10
|
+
config_param :output_type, :default => :json do |val|
|
11
|
+
case val.downcase
|
12
|
+
when 'json'
|
13
|
+
:json
|
14
|
+
when 'hash'
|
15
|
+
:hash
|
16
|
+
else
|
17
|
+
raise ConfigError, "bufferd stdout output output_type should be 'json' or 'hash'"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def configure(conf)
|
22
|
+
super
|
23
|
+
@output_proc = OUTPUT_PROCS[@output_type]
|
24
|
+
end
|
25
|
+
|
26
|
+
def write_objects(tag, es)
|
27
|
+
now = Time.now
|
28
|
+
es.each {|time,record|
|
29
|
+
$log.write "#{now.localtime} #{Time.at(time).localtime} #{tag}: #{@output_proc.call(record)}\n"
|
30
|
+
}
|
31
|
+
$log.flush
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fluent-plugin-buffered-stdout
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- TAGOMORI Satoshi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: fluentd
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Fluentd STDOUT output plugin with buffering, for buffer plugin tests
|
56
|
+
only
|
57
|
+
email:
|
58
|
+
- tagomoris@gmail.com
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- .gitignore
|
64
|
+
- Gemfile
|
65
|
+
- LICENSE.txt
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- fluent-plugin-buffered-stdout.gemspec
|
69
|
+
- lib/fluent/plugin/out_buffered_stdout.rb
|
70
|
+
homepage: https://github.com/tagomoris/fluent-plugin-buffered-stdout
|
71
|
+
licenses:
|
72
|
+
- APLv2
|
73
|
+
metadata: {}
|
74
|
+
post_install_message:
|
75
|
+
rdoc_options: []
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
requirements: []
|
89
|
+
rubyforge_project:
|
90
|
+
rubygems_version: 2.0.3
|
91
|
+
signing_key:
|
92
|
+
specification_version: 4
|
93
|
+
summary: Buffered stdout output plugin for Fluentd
|
94
|
+
test_files: []
|
95
|
+
has_rdoc:
|