fluent-plugin-split-array 0.0.2 → 0.1.0
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 +4 -4
- data/.travis.yml +4 -2
- data/README.md +7 -0
- data/fluent-plugin-split-array.gemspec +2 -2
- data/lib/fluent/plugin/filter_split_array.rb +4 -2
- data/test/plugin/test_filter_split_array.rb +7 -5
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6df2584179260960a48190fec02271c9920a2034
|
4
|
+
data.tar.gz: 17e2fb17f0a13da772942a896fdf1bd63be96e67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9da71017b79e501df231cea4a8d31b839ed383211f610f8dfad99fc9099fd399ed5020aaadc1accf33f86924e17b66fa990ee8da4415ec9186b3db225671ccb
|
7
|
+
data.tar.gz: 9d45e9c6271240b8462db45eef58fd7048f5f28f897c1fbd337309064d34ee3ef95ef871b692fec3d7bee8e74726bd091257be18482dc42550c921bb4c1cb51b
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -12,6 +12,13 @@ Fluent filter plugin to split array
|
|
12
12
|
gem install fluent-plugin-split-array
|
13
13
|
```
|
14
14
|
|
15
|
+
### Requirements
|
16
|
+
|
17
|
+
| fluent-plugin-script | fluentd |
|
18
|
+
|----------------------|------------|
|
19
|
+
| >= 0.1.0 | >= v0.14.0 |
|
20
|
+
| < 0.0.2 | < v0.14.0 |
|
21
|
+
|
15
22
|
## Configuration Example
|
16
23
|
|
17
24
|
```
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "fluent-plugin-split-array"
|
3
|
-
s.version = "0.0
|
3
|
+
s.version = "0.1.0"
|
4
4
|
s.licenses = ["MIT"]
|
5
5
|
s.summary = "Fluentd filter plugin to split array"
|
6
6
|
s.description = s.summary
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.test_files = `git ls-files -- test/*`.split("\n")
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
|
14
|
-
s.add_runtime_dependency "fluentd", "
|
14
|
+
s.add_runtime_dependency "fluentd", [">= 0.14.0", "< 2"]
|
15
15
|
s.add_development_dependency "rake", "~> 10.4"
|
16
16
|
s.add_development_dependency "test-unit", "~> 3.1"
|
17
17
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'fluent/plugin/filter'
|
2
|
+
|
3
|
+
module Fluent::Plugin
|
2
4
|
class SplitArrayFilter < Filter
|
3
5
|
Fluent::Plugin.register_filter('split_array', self)
|
4
6
|
|
@@ -6,7 +8,7 @@ module Fluent
|
|
6
8
|
config_param :split_key, :string, default: nil
|
7
9
|
|
8
10
|
def filter_stream(tag, es)
|
9
|
-
new_es = MultiEventStream.new
|
11
|
+
new_es = Fluent::MultiEventStream.new
|
10
12
|
es.each {|time, record|
|
11
13
|
target_record = @split_key.nil? ? record : record[@split_key] || {}
|
12
14
|
split(time, target_record, new_es)
|
@@ -2,6 +2,7 @@ require 'bundler/setup'
|
|
2
2
|
require 'test/unit'
|
3
3
|
require 'fluent/log'
|
4
4
|
require 'fluent/test'
|
5
|
+
require 'fluent/test/driver/filter'
|
5
6
|
require 'fluent/plugin/filter_split_array'
|
6
7
|
|
7
8
|
class RubyFilterTest < Test::Unit::TestCase
|
@@ -12,10 +13,11 @@ class RubyFilterTest < Test::Unit::TestCase
|
|
12
13
|
end
|
13
14
|
|
14
15
|
def emit(msg, conf='')
|
15
|
-
d = Test::
|
16
|
-
d.run {
|
17
|
-
d.
|
18
|
-
}
|
16
|
+
d = Test::Driver::Filter.new(Plugin::SplitArrayFilter).configure(conf)
|
17
|
+
d.run(default_tag: 'test') {
|
18
|
+
d.feed(msg)
|
19
|
+
}
|
20
|
+
d.filtered
|
19
21
|
end
|
20
22
|
|
21
23
|
sub_test_case 'filter' do
|
@@ -24,7 +26,7 @@ class RubyFilterTest < Test::Unit::TestCase
|
|
24
26
|
es = emit(msg)
|
25
27
|
assert_equal(msg.count, es.count)
|
26
28
|
es.each_with_index do |e, i|
|
27
|
-
assert_equal(msg[i], e[
|
29
|
+
assert_equal(msg[i], e[0])
|
28
30
|
end
|
29
31
|
end
|
30
32
|
test 'execute to hash' do
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-split-array
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SNakano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.14.0
|
20
|
+
- - "<"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
22
|
+
version: '2'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.14.0
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
32
|
+
version: '2'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rake
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
93
|
version: '0'
|
88
94
|
requirements: []
|
89
95
|
rubyforge_project:
|
90
|
-
rubygems_version: 2.6.
|
96
|
+
rubygems_version: 2.6.13
|
91
97
|
signing_key:
|
92
98
|
specification_version: 4
|
93
99
|
summary: Fluentd filter plugin to split array
|