fluent-plugin-unit-time-filter 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +73 -0
- data/Rakefile +5 -0
- data/fluent-plugin-unit-time-filter.gemspec +21 -0
- data/lib/fluent/plugin/out_unit_time_filter.rb +63 -0
- data/lib/fluent/plugin/unit_time_filter_buffer.rb +99 -0
- data/spec/out_unit_time_filter_spec.rb +236 -0
- data/spec/spec_helper.rb +63 -0
- metadata +113 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cb21bb8de5296e1949d37a65ae7edb5e7ac6cccb
|
4
|
+
data.tar.gz: 1ac61305e86d61a953d9c56756d9731f596f4cbc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e1eab0e7c3d5f0c351a73ef7756dcef08837c38c8e8d5edd5127324e6ca0733e541b3343966bcd77ec2c352bd2c4b5955384f6c893c8bb1b5a7ff24a3504bd37
|
7
|
+
data.tar.gz: f89b7f1b131bdb410ec6908864b448fd6b9ea0d8c4d4e14c67d06d2cabf1bc97f8ccfff21ca767dde0a87a6f2837902f13e2d3f89516d43efa61fd56b0ace073
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Genki Sugawara
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# fluent-plugin-unit-time-filter
|
2
|
+
|
3
|
+
Plug-in to aggregate by unit time
|
4
|
+
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/fluent-plugin-unit-time-filter.png)](http://badge.fury.io/rb/fluent-plugin-unit-time-filter)
|
6
|
+
[![Build Status](https://drone.io/bitbucket.org/winebarrel/fluent-plugin-unit-time-filter/status.png)](https://drone.io/bitbucket.org/winebarrel/fluent-plugin-unit-time-filter/latest)
|
7
|
+
|
8
|
+
## Configuration
|
9
|
+
|
10
|
+
```
|
11
|
+
<match my.**>
|
12
|
+
type unit_time_filter
|
13
|
+
filter_path /foo/bar/my_filrer.rb
|
14
|
+
unit_sec 10
|
15
|
+
#prefix filtered
|
16
|
+
#emit_each_tag false
|
17
|
+
#pass_hash_row false
|
18
|
+
#hash_row_time_key time
|
19
|
+
#hash_row_tag_key tag
|
20
|
+
</match>
|
21
|
+
|
22
|
+
<match filtered.my.**>
|
23
|
+
type stdout
|
24
|
+
</match>
|
25
|
+
```
|
26
|
+
|
27
|
+
## Filter
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
# Count the number of records of every unit time
|
31
|
+
|
32
|
+
proc {|records|
|
33
|
+
|
34
|
+
# `records` is an Array such as:
|
35
|
+
# [[tag, time, record], [tag, time, record], ...]
|
36
|
+
#
|
37
|
+
# e.g.)
|
38
|
+
# [["my.data", 1391820170, {"hoge"=>"fuga"}],
|
39
|
+
# ["my.data", 1391820170, {"hoge"=>"fuga"}],
|
40
|
+
# ["my.data", 1391820170, {"hoge"=>"fuga"}],
|
41
|
+
# ...
|
42
|
+
|
43
|
+
{'count' => records.count}
|
44
|
+
# or [{...},{...},{...}, ...]
|
45
|
+
}
|
46
|
+
```
|
47
|
+
|
48
|
+
## Usage
|
49
|
+
|
50
|
+
Run the following command:
|
51
|
+
|
52
|
+
```sh
|
53
|
+
while true; do
|
54
|
+
echo '{"hoge":"fuga"}' | fluent-cat my.data
|
55
|
+
done
|
56
|
+
```
|
57
|
+
|
58
|
+
fluentd outputs the following:
|
59
|
+
|
60
|
+
```
|
61
|
+
2014-02-08 00:38:40 +0900 filtered.my.data: {"count":42}
|
62
|
+
2014-02-08 00:38:50 +0900 filtered.my.data: {"count":43}
|
63
|
+
2014-02-08 00:39:00 +0900 filtered.my.data: {"count":41}
|
64
|
+
...
|
65
|
+
```
|
66
|
+
|
67
|
+
## Contributing
|
68
|
+
|
69
|
+
1. Fork it
|
70
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
71
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
72
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
73
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
Gem::Specification.new do |spec|
|
3
|
+
spec.name = "fluent-plugin-unit-time-filter"
|
4
|
+
spec.version = "0.1.0"
|
5
|
+
spec.authors = ["Genki Sugawara"]
|
6
|
+
spec.email = ["sgwr_dts@yahoo.co.jp"]
|
7
|
+
spec.description = %q{Plug-in to aggregate by unit time}
|
8
|
+
spec.summary = %q{Plug-in to aggregate by unit time}
|
9
|
+
spec.homepage = "https://bitbucket.org/winebarrel/fluent-plugin-unit-time-filter"
|
10
|
+
spec.license = "MIT"
|
11
|
+
|
12
|
+
spec.files = `git ls-files`.split($/)
|
13
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
14
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
15
|
+
spec.require_paths = ["lib"]
|
16
|
+
|
17
|
+
spec.add_dependency "fluentd"
|
18
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
19
|
+
spec.add_development_dependency "rake"
|
20
|
+
spec.add_development_dependency 'rspec', '>= 2.11.0'
|
21
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'fluent/plugin/unit_time_filter_buffer'
|
2
|
+
|
3
|
+
class Fluent::UnitTimeFilterOutput < Fluent::Output
|
4
|
+
Fluent::Plugin.register_output('unit_time_filter', self)
|
5
|
+
|
6
|
+
config_param :filter_path, :type => :string
|
7
|
+
config_param :unit_sec, :type => :size, :default => 1
|
8
|
+
config_param :prefix, :type => :string, :default => 'filtered'
|
9
|
+
config_param :emit_each_tag, :type => :bool, :default => false
|
10
|
+
config_param :pass_hash_row, :type => :bool, :default => false
|
11
|
+
config_param :hash_row_time_key, :type => :string, :default => 'time'
|
12
|
+
config_param :hash_row_tag_key, :type => :string, :default => 'tag'
|
13
|
+
|
14
|
+
BUFFER_KEY = :unit_time_filter_buffer
|
15
|
+
|
16
|
+
def configure(conf)
|
17
|
+
super
|
18
|
+
|
19
|
+
unless File.exist?(@filter_path)
|
20
|
+
raise Fluent::ConfigError, "No such file: #{@filter_path}"
|
21
|
+
end
|
22
|
+
|
23
|
+
begin
|
24
|
+
@filter = Object.new.instance_eval(File.read(@filter_path))
|
25
|
+
rescue => e
|
26
|
+
raise Fluent::ConfigError, "Invalid filter: #{@filter_path}: #{e}"
|
27
|
+
end
|
28
|
+
|
29
|
+
unless @filter.kind_of?(Proc)
|
30
|
+
raise Fluent::ConfigError, "Invalid filter: #{@filter_path}: Filter must be Proc"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def shutdown
|
35
|
+
super
|
36
|
+
Thread.current[BUFFER_KEY] = nil
|
37
|
+
end
|
38
|
+
|
39
|
+
def buffer
|
40
|
+
buf = Thread.current[BUFFER_KEY]
|
41
|
+
|
42
|
+
unless buf
|
43
|
+
buf = Buffer.new({
|
44
|
+
:filter => @filter,
|
45
|
+
:unit_sec => @unit_sec,
|
46
|
+
:prefix => @prefix,
|
47
|
+
:emit_each_tag => @emit_each_tag,
|
48
|
+
:pass_hash_row => @pass_hash_row,
|
49
|
+
:hash_row_time_key => @hash_row_time_key,
|
50
|
+
:hash_row_tag_key => @hash_row_tag_key,
|
51
|
+
})
|
52
|
+
|
53
|
+
Thread.current[BUFFER_KEY] = buf
|
54
|
+
end
|
55
|
+
|
56
|
+
return buf
|
57
|
+
end
|
58
|
+
|
59
|
+
def emit(tag, es, chain)
|
60
|
+
buffer.resume(tag, es)
|
61
|
+
chain.next
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
class Fluent::UnitTimeFilterOutput < Fluent::Output
|
2
|
+
class Buffer
|
3
|
+
include Enumerable
|
4
|
+
|
5
|
+
def initialize(options)
|
6
|
+
@init_queue = []
|
7
|
+
|
8
|
+
@fiber = Fiber.new do |tag, es|
|
9
|
+
@init_queue << [tag, es]
|
10
|
+
run(options)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def each
|
15
|
+
loop do
|
16
|
+
tag, es = @init_queue.shift || Fiber.yield
|
17
|
+
break unless (tag && es)
|
18
|
+
|
19
|
+
es.each do |time, record|
|
20
|
+
yield([tag, time, record])
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def resume(tag, es)
|
26
|
+
@fiber.resume(tag, es)
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def run(options)
|
32
|
+
filter = options[:filter]
|
33
|
+
unit_sec = options[:unit_sec]
|
34
|
+
prefix = options[:prefix]
|
35
|
+
emit_each_tag = options[:emit_each_tag]
|
36
|
+
pass_hash_row = options[:pass_hash_row]
|
37
|
+
|
38
|
+
prev_time = nil
|
39
|
+
|
40
|
+
self.chunk {|tag, time, record|
|
41
|
+
time
|
42
|
+
}.slice_before {|time, records|
|
43
|
+
result = (time % unit_sec).zero? || (prev_time && minus_r(time, unit_sec) != minus_r(prev_time, unit_sec))
|
44
|
+
prev_time = time
|
45
|
+
result
|
46
|
+
}.each {|records|
|
47
|
+
records = records.inject([]) {|r, i| r + i[1] }
|
48
|
+
records = conv_to_hash_rows_if_needed(records, options)
|
49
|
+
|
50
|
+
time = get_time(records.first, options)
|
51
|
+
time -= time % unit_sec
|
52
|
+
|
53
|
+
rs = filter.call(records)
|
54
|
+
rs = [rs] unless rs.kind_of?(Array)
|
55
|
+
|
56
|
+
if emit_each_tag
|
57
|
+
tags = records.map {|r| get_tag(r, options) }.uniq
|
58
|
+
tags.each {|t| emit_records(prefix, t, time, rs) }
|
59
|
+
else
|
60
|
+
tag = get_tag(records.first, options)
|
61
|
+
emit_records(prefix, tag, time, rs)
|
62
|
+
end
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
def emit_records(prefix, tag, time, records)
|
67
|
+
records.each do |record|
|
68
|
+
Fluent::Engine.emit("#{prefix}.#{tag}", time, record)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def conv_to_hash_rows_if_needed(records, options)
|
73
|
+
return records unless options[:pass_hash_row]
|
74
|
+
|
75
|
+
time_key = options[:hash_row_time_key]
|
76
|
+
tag_key = options[:hash_row_tag_key]
|
77
|
+
|
78
|
+
records.map do |tag, time, r|
|
79
|
+
r[time_key] = time
|
80
|
+
r[tag_key] = tag
|
81
|
+
r
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def get_time(record, options)
|
86
|
+
time_key = options[:hash_row_time_key]
|
87
|
+
options[:pass_hash_row] ? record[time_key] : record[1]
|
88
|
+
end
|
89
|
+
|
90
|
+
def get_tag(record, options)
|
91
|
+
tag_key = options[:hash_row_tag_key]
|
92
|
+
options[:pass_hash_row] ? record[tag_key] : record[0]
|
93
|
+
end
|
94
|
+
|
95
|
+
def minus_r(m, n)
|
96
|
+
m - (m % n)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,236 @@
|
|
1
|
+
describe Fluent::UnitTimeFilterOutput do
|
2
|
+
let(:time) {
|
3
|
+
Time.parse('2014-02-08 13:14:15 +0900').to_i
|
4
|
+
}
|
5
|
+
|
6
|
+
describe 'when 2 records transmitted per second' do
|
7
|
+
it 'should be aggregated to two records' do
|
8
|
+
run_driver do |d|
|
9
|
+
(0...10).each do |i|
|
10
|
+
d.emit({"key#{i}" => "val#{i}"}, time + i)
|
11
|
+
d.emit({"key#{i}_" => "val#{i}_"}, time + i)
|
12
|
+
end
|
13
|
+
|
14
|
+
expect(d.emits).to eq(
|
15
|
+
[["filtered.test.default", 1391832855, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832855, {\"key0\"=>\"val0\"}], [\"test.default\", 1391832855, {\"key0_\"=>\"val0_\"}]]"}],
|
16
|
+
["filtered.test.default", 1391832856, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832856, {\"key1\"=>\"val1\"}], [\"test.default\", 1391832856, {\"key1_\"=>\"val1_\"}]]"}],
|
17
|
+
["filtered.test.default", 1391832857, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832857, {\"key2\"=>\"val2\"}], [\"test.default\", 1391832857, {\"key2_\"=>\"val2_\"}]]"}],
|
18
|
+
["filtered.test.default", 1391832858, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832858, {\"key3\"=>\"val3\"}], [\"test.default\", 1391832858, {\"key3_\"=>\"val3_\"}]]"}],
|
19
|
+
["filtered.test.default", 1391832859, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832859, {\"key4\"=>\"val4\"}], [\"test.default\", 1391832859, {\"key4_\"=>\"val4_\"}]]"}],
|
20
|
+
["filtered.test.default", 1391832860, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832860, {\"key5\"=>\"val5\"}], [\"test.default\", 1391832860, {\"key5_\"=>\"val5_\"}]]"}],
|
21
|
+
["filtered.test.default", 1391832861, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832861, {\"key6\"=>\"val6\"}], [\"test.default\", 1391832861, {\"key6_\"=>\"val6_\"}]]"}],
|
22
|
+
["filtered.test.default", 1391832862, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832862, {\"key7\"=>\"val7\"}], [\"test.default\", 1391832862, {\"key7_\"=>\"val7_\"}]]"}]]
|
23
|
+
)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should be rewritten to the specified tag' do
|
28
|
+
run_driver(:prefix => 'any_prefix') do |d|
|
29
|
+
(0...10).each do |i|
|
30
|
+
d.emit({"key#{i}" => "val#{i}"}, time + i)
|
31
|
+
d.emit({"key#{i}_" => "val#{i}_"}, time + i)
|
32
|
+
end
|
33
|
+
|
34
|
+
expect(d.emits).to eq(
|
35
|
+
[["any_prefix.test.default", 1391832855, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832855, {\"key0\"=>\"val0\"}], [\"test.default\", 1391832855, {\"key0_\"=>\"val0_\"}]]"}],
|
36
|
+
["any_prefix.test.default", 1391832856, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832856, {\"key1\"=>\"val1\"}], [\"test.default\", 1391832856, {\"key1_\"=>\"val1_\"}]]"}],
|
37
|
+
["any_prefix.test.default", 1391832857, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832857, {\"key2\"=>\"val2\"}], [\"test.default\", 1391832857, {\"key2_\"=>\"val2_\"}]]"}],
|
38
|
+
["any_prefix.test.default", 1391832858, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832858, {\"key3\"=>\"val3\"}], [\"test.default\", 1391832858, {\"key3_\"=>\"val3_\"}]]"}],
|
39
|
+
["any_prefix.test.default", 1391832859, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832859, {\"key4\"=>\"val4\"}], [\"test.default\", 1391832859, {\"key4_\"=>\"val4_\"}]]"}],
|
40
|
+
["any_prefix.test.default", 1391832860, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832860, {\"key5\"=>\"val5\"}], [\"test.default\", 1391832860, {\"key5_\"=>\"val5_\"}]]"}],
|
41
|
+
["any_prefix.test.default", 1391832861, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832861, {\"key6\"=>\"val6\"}], [\"test.default\", 1391832861, {\"key6_\"=>\"val6_\"}]]"}],
|
42
|
+
["any_prefix.test.default", 1391832862, {"count"=>2, "inspect"=>"[[\"test.default\", 1391832862, {\"key7\"=>\"val7\"}], [\"test.default\", 1391832862, {\"key7_\"=>\"val7_\"}]]"}]]
|
43
|
+
)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'should receive multiple converted records' do
|
48
|
+
filter = <<-EOS
|
49
|
+
proc {|rs|
|
50
|
+
[
|
51
|
+
{'foo' => 'bar', 100 => 200},
|
52
|
+
{'bar' => 'baz', 200 => 300},
|
53
|
+
]
|
54
|
+
}
|
55
|
+
EOS
|
56
|
+
|
57
|
+
run_driver(:filter => filter) do |d|
|
58
|
+
(0...10).each do |i|
|
59
|
+
d.emit({"key#{i}" => "val#{i}"}, time + i)
|
60
|
+
d.emit({"key#{i}_" => "val#{i}_"}, time + i)
|
61
|
+
end
|
62
|
+
|
63
|
+
expect(d.emits).to eq(
|
64
|
+
[["filtered.test.default", 1391832855, {"foo"=>"bar", 100=>200}],
|
65
|
+
["filtered.test.default", 1391832855, {"bar"=>"baz", 200=>300}],
|
66
|
+
["filtered.test.default", 1391832856, {"foo"=>"bar", 100=>200}],
|
67
|
+
["filtered.test.default", 1391832856, {"bar"=>"baz", 200=>300}],
|
68
|
+
["filtered.test.default", 1391832857, {"foo"=>"bar", 100=>200}],
|
69
|
+
["filtered.test.default", 1391832857, {"bar"=>"baz", 200=>300}],
|
70
|
+
["filtered.test.default", 1391832858, {"foo"=>"bar", 100=>200}],
|
71
|
+
["filtered.test.default", 1391832858, {"bar"=>"baz", 200=>300}],
|
72
|
+
["filtered.test.default", 1391832859, {"foo"=>"bar", 100=>200}],
|
73
|
+
["filtered.test.default", 1391832859, {"bar"=>"baz", 200=>300}],
|
74
|
+
["filtered.test.default", 1391832860, {"foo"=>"bar", 100=>200}],
|
75
|
+
["filtered.test.default", 1391832860, {"bar"=>"baz", 200=>300}],
|
76
|
+
["filtered.test.default", 1391832861, {"foo"=>"bar", 100=>200}],
|
77
|
+
["filtered.test.default", 1391832861, {"bar"=>"baz", 200=>300}],
|
78
|
+
["filtered.test.default", 1391832862, {"foo"=>"bar", 100=>200}],
|
79
|
+
["filtered.test.default", 1391832862, {"bar"=>"baz", 200=>300}]]
|
80
|
+
)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
describe 'when 3 records transmitted per second' do
|
86
|
+
it 'should be aggregated to two records' do
|
87
|
+
run_driver do |d|
|
88
|
+
(0...10).each do |i|
|
89
|
+
d.emit({"key#{i}" => "val#{i}"}, time + i)
|
90
|
+
d.emit({"key#{i}_" => "val#{i}_"}, time + i)
|
91
|
+
d.emit({"key#{i}__" => "val#{i}__"}, time + i)
|
92
|
+
end
|
93
|
+
|
94
|
+
expect(d.emits).to eq(
|
95
|
+
[["filtered.test.default", 1391832855, {"count"=>3, "inspect"=>"[[\"test.default\", 1391832855, {\"key0\"=>\"val0\"}], [\"test.default\", 1391832855, {\"key0_\"=>\"val0_\"}], [\"test.default\", 1391832855, {\"key0__\"=>\"val0__\"}]]"}],
|
96
|
+
["filtered.test.default", 1391832856, {"count"=>3, "inspect"=>"[[\"test.default\", 1391832856, {\"key1\"=>\"val1\"}], [\"test.default\", 1391832856, {\"key1_\"=>\"val1_\"}], [\"test.default\", 1391832856, {\"key1__\"=>\"val1__\"}]]"}],
|
97
|
+
["filtered.test.default", 1391832857, {"count"=>3, "inspect"=>"[[\"test.default\", 1391832857, {\"key2\"=>\"val2\"}], [\"test.default\", 1391832857, {\"key2_\"=>\"val2_\"}], [\"test.default\", 1391832857, {\"key2__\"=>\"val2__\"}]]"}],
|
98
|
+
["filtered.test.default", 1391832858, {"count"=>3, "inspect"=>"[[\"test.default\", 1391832858, {\"key3\"=>\"val3\"}], [\"test.default\", 1391832858, {\"key3_\"=>\"val3_\"}], [\"test.default\", 1391832858, {\"key3__\"=>\"val3__\"}]]"}],
|
99
|
+
["filtered.test.default", 1391832859, {"count"=>3, "inspect"=>"[[\"test.default\", 1391832859, {\"key4\"=>\"val4\"}], [\"test.default\", 1391832859, {\"key4_\"=>\"val4_\"}], [\"test.default\", 1391832859, {\"key4__\"=>\"val4__\"}]]"}],
|
100
|
+
["filtered.test.default", 1391832860, {"count"=>3, "inspect"=>"[[\"test.default\", 1391832860, {\"key5\"=>\"val5\"}], [\"test.default\", 1391832860, {\"key5_\"=>\"val5_\"}], [\"test.default\", 1391832860, {\"key5__\"=>\"val5__\"}]]"}],
|
101
|
+
["filtered.test.default", 1391832861, {"count"=>3, "inspect"=>"[[\"test.default\", 1391832861, {\"key6\"=>\"val6\"}], [\"test.default\", 1391832861, {\"key6_\"=>\"val6_\"}], [\"test.default\", 1391832861, {\"key6__\"=>\"val6__\"}]]"}],
|
102
|
+
["filtered.test.default", 1391832862, {"count"=>3, "inspect"=>"[[\"test.default\", 1391832862, {\"key7\"=>\"val7\"}], [\"test.default\", 1391832862, {\"key7_\"=>\"val7_\"}], [\"test.default\", 1391832862, {\"key7__\"=>\"val7__\"}]]"}]]
|
103
|
+
)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
describe 'when unit_sec 10' do
|
109
|
+
it 'should be aggregated by every 10 sec' do
|
110
|
+
run_driver(:unit_sec => 10) do |d|
|
111
|
+
(0...30).step(5) do |i|
|
112
|
+
d.emit({"key#{i}" => "val#{i}"}, time + i)
|
113
|
+
d.emit({"key#{i}_" => "val#{i}_"}, time + i)
|
114
|
+
d.emit({"key#{i}__" => "val#{i}__"}, time + i)
|
115
|
+
end
|
116
|
+
|
117
|
+
expect(d.emits).to eq(
|
118
|
+
[["filtered.test.default", 1391832850, {"count"=>3, "inspect"=>"[[\"test.default\", 1391832855, {\"key0\"=>\"val0\"}], [\"test.default\", 1391832855, {\"key0_\"=>\"val0_\"}], [\"test.default\", 1391832855, {\"key0__\"=>\"val0__\"}]]"}],
|
119
|
+
["filtered.test.default", 1391832860, {"count"=>6, "inspect"=>"[[\"test.default\", 1391832860, {\"key5\"=>\"val5\"}], [\"test.default\", 1391832860, {\"key5_\"=>\"val5_\"}], [\"test.default\", 1391832860, {\"key5__\"=>\"val5__\"}], [\"test.default\", 1391832865, {\"key10\"=>\"val10\"}], [\"test.default\", 1391832865, {\"key10_\"=>\"val10_\"}], [\"test.default\", 1391832865, {\"key10__\"=>\"val10__\"}]]"}]]
|
120
|
+
)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
it 'should be aggregated by every 10 sec' do
|
125
|
+
run_driver(:unit_sec => 10) do |d|
|
126
|
+
(0...100).step(20) do |i|
|
127
|
+
d.emit({"key#{i}" => "val#{i}"}, time + i)
|
128
|
+
d.emit({"key#{i}_" => "val#{i}_"}, time + i)
|
129
|
+
d.emit({"key#{i}__" => "val#{i}__"}, time + i)
|
130
|
+
end
|
131
|
+
|
132
|
+
expect(d.emits).to eq(
|
133
|
+
[["filtered.test.default", 1391832850, {"count"=>3, "inspect"=>"[[\"test.default\", 1391832855, {\"key0\"=>\"val0\"}], [\"test.default\", 1391832855, {\"key0_\"=>\"val0_\"}], [\"test.default\", 1391832855, {\"key0__\"=>\"val0__\"}]]"}],
|
134
|
+
["filtered.test.default", 1391832870, {"count"=>3, "inspect"=>"[[\"test.default\", 1391832875, {\"key20\"=>\"val20\"}], [\"test.default\", 1391832875, {\"key20_\"=>\"val20_\"}], [\"test.default\", 1391832875, {\"key20__\"=>\"val20__\"}]]"}],
|
135
|
+
["filtered.test.default", 1391832890, {"count"=>3, "inspect"=>"[[\"test.default\", 1391832895, {\"key40\"=>\"val40\"}], [\"test.default\", 1391832895, {\"key40_\"=>\"val40_\"}], [\"test.default\", 1391832895, {\"key40__\"=>\"val40__\"}]]"}]]
|
136
|
+
)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
describe 'when multiple tags' do
|
142
|
+
it 'should be output only the first tag' do
|
143
|
+
run_driver do |d|
|
144
|
+
(0...10).each do |i|
|
145
|
+
d.tag = 'test.1'
|
146
|
+
d.emit({"key#{i}" => "val#{i}"}, time + i)
|
147
|
+
d.tag = 'test.2'
|
148
|
+
d.emit({"key#{i}_" => "val#{i}_"}, time + i)
|
149
|
+
end
|
150
|
+
|
151
|
+
expect(d.emits).to eq(
|
152
|
+
[["filtered.test.1", 1391832855, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832855, {\"key0\"=>\"val0\"}], [\"test.2\", 1391832855, {\"key0_\"=>\"val0_\"}]]"}],
|
153
|
+
["filtered.test.1", 1391832856, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832856, {\"key1\"=>\"val1\"}], [\"test.2\", 1391832856, {\"key1_\"=>\"val1_\"}]]"}],
|
154
|
+
["filtered.test.1", 1391832857, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832857, {\"key2\"=>\"val2\"}], [\"test.2\", 1391832857, {\"key2_\"=>\"val2_\"}]]"}],
|
155
|
+
["filtered.test.1", 1391832858, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832858, {\"key3\"=>\"val3\"}], [\"test.2\", 1391832858, {\"key3_\"=>\"val3_\"}]]"}],
|
156
|
+
["filtered.test.1", 1391832859, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832859, {\"key4\"=>\"val4\"}], [\"test.2\", 1391832859, {\"key4_\"=>\"val4_\"}]]"}],
|
157
|
+
["filtered.test.1", 1391832860, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832860, {\"key5\"=>\"val5\"}], [\"test.2\", 1391832860, {\"key5_\"=>\"val5_\"}]]"}],
|
158
|
+
["filtered.test.1", 1391832861, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832861, {\"key6\"=>\"val6\"}], [\"test.2\", 1391832861, {\"key6_\"=>\"val6_\"}]]"}],
|
159
|
+
["filtered.test.1", 1391832862, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832862, {\"key7\"=>\"val7\"}], [\"test.2\", 1391832862, {\"key7_\"=>\"val7_\"}]]"}]]
|
160
|
+
)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
it 'should be output to each tag' do
|
165
|
+
run_driver(:emit_each_tag => true) do |d|
|
166
|
+
(0...10).each do |i|
|
167
|
+
d.tag = 'test.1'
|
168
|
+
d.emit({"key#{i}" => "val#{i}"}, time + i)
|
169
|
+
d.tag = 'test.2'
|
170
|
+
d.emit({"key#{i}_" => "val#{i}_"}, time + i)
|
171
|
+
end
|
172
|
+
|
173
|
+
expect(d.emits).to eq(
|
174
|
+
[["filtered.test.1", 1391832855, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832855, {\"key0\"=>\"val0\"}], [\"test.2\", 1391832855, {\"key0_\"=>\"val0_\"}]]"}],
|
175
|
+
["filtered.test.2", 1391832855, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832855, {\"key0\"=>\"val0\"}], [\"test.2\", 1391832855, {\"key0_\"=>\"val0_\"}]]"}],
|
176
|
+
["filtered.test.1", 1391832856, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832856, {\"key1\"=>\"val1\"}], [\"test.2\", 1391832856, {\"key1_\"=>\"val1_\"}]]"}],
|
177
|
+
["filtered.test.2", 1391832856, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832856, {\"key1\"=>\"val1\"}], [\"test.2\", 1391832856, {\"key1_\"=>\"val1_\"}]]"}],
|
178
|
+
["filtered.test.1", 1391832857, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832857, {\"key2\"=>\"val2\"}], [\"test.2\", 1391832857, {\"key2_\"=>\"val2_\"}]]"}],
|
179
|
+
["filtered.test.2", 1391832857, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832857, {\"key2\"=>\"val2\"}], [\"test.2\", 1391832857, {\"key2_\"=>\"val2_\"}]]"}],
|
180
|
+
["filtered.test.1", 1391832858, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832858, {\"key3\"=>\"val3\"}], [\"test.2\", 1391832858, {\"key3_\"=>\"val3_\"}]]"}],
|
181
|
+
["filtered.test.2", 1391832858, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832858, {\"key3\"=>\"val3\"}], [\"test.2\", 1391832858, {\"key3_\"=>\"val3_\"}]]"}],
|
182
|
+
["filtered.test.1", 1391832859, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832859, {\"key4\"=>\"val4\"}], [\"test.2\", 1391832859, {\"key4_\"=>\"val4_\"}]]"}],
|
183
|
+
["filtered.test.2", 1391832859, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832859, {\"key4\"=>\"val4\"}], [\"test.2\", 1391832859, {\"key4_\"=>\"val4_\"}]]"}],
|
184
|
+
["filtered.test.1", 1391832860, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832860, {\"key5\"=>\"val5\"}], [\"test.2\", 1391832860, {\"key5_\"=>\"val5_\"}]]"}],
|
185
|
+
["filtered.test.2", 1391832860, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832860, {\"key5\"=>\"val5\"}], [\"test.2\", 1391832860, {\"key5_\"=>\"val5_\"}]]"}],
|
186
|
+
["filtered.test.1", 1391832861, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832861, {\"key6\"=>\"val6\"}], [\"test.2\", 1391832861, {\"key6_\"=>\"val6_\"}]]"}],
|
187
|
+
["filtered.test.2", 1391832861, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832861, {\"key6\"=>\"val6\"}], [\"test.2\", 1391832861, {\"key6_\"=>\"val6_\"}]]"}],
|
188
|
+
["filtered.test.1", 1391832862, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832862, {\"key7\"=>\"val7\"}], [\"test.2\", 1391832862, {\"key7_\"=>\"val7_\"}]]"}],
|
189
|
+
["filtered.test.2", 1391832862, {"count"=>2, "inspect"=>"[[\"test.1\", 1391832862, {\"key7\"=>\"val7\"}], [\"test.2\", 1391832862, {\"key7_\"=>\"val7_\"}]]"}]]
|
190
|
+
)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
describe 'when the array of Hash is passed' do
|
196
|
+
it 'should receive an array of Hash' do
|
197
|
+
run_driver(:pass_hash_row => true) do |d|
|
198
|
+
(0...10).each do |i|
|
199
|
+
d.emit({"key#{i}" => "val#{i}"}, time + i)
|
200
|
+
d.emit({"key#{i}_" => "val#{i}_"}, time + i)
|
201
|
+
end
|
202
|
+
|
203
|
+
expect(d.emits).to eq(
|
204
|
+
[["filtered.test.default", 1391832855, {"count"=>2, "inspect"=>"[{\"key0\"=>\"val0\", \"time\"=>1391832855, \"tag\"=>\"test.default\"}, {\"key0_\"=>\"val0_\", \"time\"=>1391832855, \"tag\"=>\"test.default\"}]"}],
|
205
|
+
["filtered.test.default", 1391832856, {"count"=>2, "inspect"=>"[{\"key1\"=>\"val1\", \"time\"=>1391832856, \"tag\"=>\"test.default\"}, {\"key1_\"=>\"val1_\", \"time\"=>1391832856, \"tag\"=>\"test.default\"}]"}],
|
206
|
+
["filtered.test.default", 1391832857, {"count"=>2, "inspect"=>"[{\"key2\"=>\"val2\", \"time\"=>1391832857, \"tag\"=>\"test.default\"}, {\"key2_\"=>\"val2_\", \"time\"=>1391832857, \"tag\"=>\"test.default\"}]"}],
|
207
|
+
["filtered.test.default", 1391832858, {"count"=>2, "inspect"=>"[{\"key3\"=>\"val3\", \"time\"=>1391832858, \"tag\"=>\"test.default\"}, {\"key3_\"=>\"val3_\", \"time\"=>1391832858, \"tag\"=>\"test.default\"}]"}],
|
208
|
+
["filtered.test.default", 1391832859, {"count"=>2, "inspect"=>"[{\"key4\"=>\"val4\", \"time\"=>1391832859, \"tag\"=>\"test.default\"}, {\"key4_\"=>\"val4_\", \"time\"=>1391832859, \"tag\"=>\"test.default\"}]"}],
|
209
|
+
["filtered.test.default", 1391832860, {"count"=>2, "inspect"=>"[{\"key5\"=>\"val5\", \"time\"=>1391832860, \"tag\"=>\"test.default\"}, {\"key5_\"=>\"val5_\", \"time\"=>1391832860, \"tag\"=>\"test.default\"}]"}],
|
210
|
+
["filtered.test.default", 1391832861, {"count"=>2, "inspect"=>"[{\"key6\"=>\"val6\", \"time\"=>1391832861, \"tag\"=>\"test.default\"}, {\"key6_\"=>\"val6_\", \"time\"=>1391832861, \"tag\"=>\"test.default\"}]"}],
|
211
|
+
["filtered.test.default", 1391832862, {"count"=>2, "inspect"=>"[{\"key7\"=>\"val7\", \"time\"=>1391832862, \"tag\"=>\"test.default\"}, {\"key7_\"=>\"val7_\", \"time\"=>1391832862, \"tag\"=>\"test.default\"}]"}]]
|
212
|
+
)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
it 'should receive an array of Hash (Not use the default key)' do
|
217
|
+
run_driver(:pass_hash_row => true, :hash_row_time_key => '__TIME__', :hash_row_tag_key => '__TAG__') do |d|
|
218
|
+
(0...10).each do |i|
|
219
|
+
d.emit({"key#{i}" => "val#{i}"}, time + i)
|
220
|
+
d.emit({"key#{i}_" => "val#{i}_"}, time + i)
|
221
|
+
end
|
222
|
+
|
223
|
+
expect(d.emits).to eq(
|
224
|
+
[["filtered.test.default", 1391832855, {"count"=>2, "inspect"=>"[{\"key0\"=>\"val0\", \"__TIME__\"=>1391832855, \"__TAG__\"=>\"test.default\"}, {\"key0_\"=>\"val0_\", \"__TIME__\"=>1391832855, \"__TAG__\"=>\"test.default\"}]"}],
|
225
|
+
["filtered.test.default", 1391832856, {"count"=>2, "inspect"=>"[{\"key1\"=>\"val1\", \"__TIME__\"=>1391832856, \"__TAG__\"=>\"test.default\"}, {\"key1_\"=>\"val1_\", \"__TIME__\"=>1391832856, \"__TAG__\"=>\"test.default\"}]"}],
|
226
|
+
["filtered.test.default", 1391832857, {"count"=>2, "inspect"=>"[{\"key2\"=>\"val2\", \"__TIME__\"=>1391832857, \"__TAG__\"=>\"test.default\"}, {\"key2_\"=>\"val2_\", \"__TIME__\"=>1391832857, \"__TAG__\"=>\"test.default\"}]"}],
|
227
|
+
["filtered.test.default", 1391832858, {"count"=>2, "inspect"=>"[{\"key3\"=>\"val3\", \"__TIME__\"=>1391832858, \"__TAG__\"=>\"test.default\"}, {\"key3_\"=>\"val3_\", \"__TIME__\"=>1391832858, \"__TAG__\"=>\"test.default\"}]"}],
|
228
|
+
["filtered.test.default", 1391832859, {"count"=>2, "inspect"=>"[{\"key4\"=>\"val4\", \"__TIME__\"=>1391832859, \"__TAG__\"=>\"test.default\"}, {\"key4_\"=>\"val4_\", \"__TIME__\"=>1391832859, \"__TAG__\"=>\"test.default\"}]"}],
|
229
|
+
["filtered.test.default", 1391832860, {"count"=>2, "inspect"=>"[{\"key5\"=>\"val5\", \"__TIME__\"=>1391832860, \"__TAG__\"=>\"test.default\"}, {\"key5_\"=>\"val5_\", \"__TIME__\"=>1391832860, \"__TAG__\"=>\"test.default\"}]"}],
|
230
|
+
["filtered.test.default", 1391832861, {"count"=>2, "inspect"=>"[{\"key6\"=>\"val6\", \"__TIME__\"=>1391832861, \"__TAG__\"=>\"test.default\"}, {\"key6_\"=>\"val6_\", \"__TIME__\"=>1391832861, \"__TAG__\"=>\"test.default\"}]"}],
|
231
|
+
["filtered.test.default", 1391832862, {"count"=>2, "inspect"=>"[{\"key7\"=>\"val7\", \"__TIME__\"=>1391832862, \"__TAG__\"=>\"test.default\"}, {\"key7_\"=>\"val7_\", \"__TIME__\"=>1391832862, \"__TAG__\"=>\"test.default\"}]"}]]
|
232
|
+
)
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
236
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'fluent/test'
|
2
|
+
require 'fluent/plugin/out_unit_time_filter'
|
3
|
+
require 'tempfile'
|
4
|
+
require 'time'
|
5
|
+
|
6
|
+
RSpec.configure do |config|
|
7
|
+
config.before(:all) do
|
8
|
+
Fluent::Test.setup
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def tempfile(content)
|
13
|
+
Tempfile.open("#{File.basename __FILE__}.#{$$}") do |f|
|
14
|
+
f << content
|
15
|
+
f.flush
|
16
|
+
f.rewind
|
17
|
+
yield(f)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def run_driver(options = {})
|
22
|
+
options = options.dup
|
23
|
+
|
24
|
+
filter = options[:filter] || (<<-EOS)
|
25
|
+
proc {|rs|
|
26
|
+
{
|
27
|
+
'count' => rs.count,
|
28
|
+
'inspect' => rs.inspect
|
29
|
+
}
|
30
|
+
}
|
31
|
+
EOS
|
32
|
+
|
33
|
+
option_keys = [
|
34
|
+
:unit_sec,
|
35
|
+
:prefix,
|
36
|
+
:emit_each_tag,
|
37
|
+
:pass_hash_row,
|
38
|
+
:hash_row_time_key,
|
39
|
+
:hash_row_tag_key,
|
40
|
+
]
|
41
|
+
|
42
|
+
additional_options = option_keys.map {|key|
|
43
|
+
if options[key]
|
44
|
+
"#{key} #{options[key]}"
|
45
|
+
end
|
46
|
+
}.join("\n")
|
47
|
+
|
48
|
+
tag = options[:tag] || 'test.default'
|
49
|
+
|
50
|
+
tempfile(filter) do |f|
|
51
|
+
fluentd_conf = <<-EOS
|
52
|
+
type unit_time_filter
|
53
|
+
filter_path #{f.path}
|
54
|
+
#{additional_options}
|
55
|
+
EOS
|
56
|
+
|
57
|
+
driver = Fluent::Test::OutputTestDriver.new(Fluent::UnitTimeFilterOutput, tag).configure(fluentd_conf)
|
58
|
+
|
59
|
+
driver.run do
|
60
|
+
yield(driver)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fluent-plugin-unit-time-filter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Genki Sugawara
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-02-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: fluentd
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.11.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.11.0
|
69
|
+
description: Plug-in to aggregate by unit time
|
70
|
+
email:
|
71
|
+
- sgwr_dts@yahoo.co.jp
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- .gitignore
|
77
|
+
- .rspec
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- fluent-plugin-unit-time-filter.gemspec
|
83
|
+
- lib/fluent/plugin/out_unit_time_filter.rb
|
84
|
+
- lib/fluent/plugin/unit_time_filter_buffer.rb
|
85
|
+
- spec/out_unit_time_filter_spec.rb
|
86
|
+
- spec/spec_helper.rb
|
87
|
+
homepage: https://bitbucket.org/winebarrel/fluent-plugin-unit-time-filter
|
88
|
+
licenses:
|
89
|
+
- MIT
|
90
|
+
metadata: {}
|
91
|
+
post_install_message:
|
92
|
+
rdoc_options: []
|
93
|
+
require_paths:
|
94
|
+
- lib
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
requirements: []
|
106
|
+
rubyforge_project:
|
107
|
+
rubygems_version: 2.0.14
|
108
|
+
signing_key:
|
109
|
+
specification_version: 4
|
110
|
+
summary: Plug-in to aggregate by unit time
|
111
|
+
test_files:
|
112
|
+
- spec/out_unit_time_filter_spec.rb
|
113
|
+
- spec/spec_helper.rb
|