fluent-plugin-add 0.0.6 → 0.0.7
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 +1 -2
- data/README.md +3 -3
- data/fluent-plugin-add.gemspec +1 -1
- data/lib/fluent/plugin/filter_add.rb +3 -1
- data/lib/fluent/plugin/out_add.rb +2 -1
- data/test/plugin/test_filter_add.rb +10 -0
- data/test/plugin/test_out_add.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cadcc4d9fff5a6fd452df91548840dc0a5958bea
|
4
|
+
data.tar.gz: 7d828143d5f3b13d567d1dcad645f450fdf44c50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfd5aeba2d5d78d7924df5af3b4c260e83850aaec80701768fb17e1ad50539e2ae334aa597a624c2146045df57d4c01c639ccf61ca65dd353d33589f64187c02
|
7
|
+
data.tar.gz: 0b6a98f8564de1bb611ad93b55212a9e6ee2a669697c2720ac651d391eaddc9f7b8b714d1e3fcae94605649c4c591d77586c64d998c6fc28cb55dcd5d4125b59
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
### AddOutput
|
14
14
|
|
15
15
|
<match test.**>
|
16
|
-
type add
|
16
|
+
@type add
|
17
17
|
add_tag_prefix debug
|
18
18
|
uuid true # optional
|
19
19
|
<pair>
|
@@ -31,8 +31,8 @@
|
|
31
31
|
### AddFilter
|
32
32
|
|
33
33
|
<filter test.**>
|
34
|
-
type add
|
35
|
-
uuid true # optional
|
34
|
+
@type add
|
35
|
+
uuid true # optional
|
36
36
|
<pair>
|
37
37
|
hoge moge
|
38
38
|
hogehoge mogemoge
|
data/fluent-plugin-add.gemspec
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "fluent-plugin-add"
|
8
|
-
spec.version = "0.0.
|
8
|
+
spec.version = "0.0.7"
|
9
9
|
spec.authors = ["yu yamada"]
|
10
10
|
spec.email = ["yu.yamada07@gmail.com"]
|
11
11
|
spec.description = %q{Output filter plugin to add messages}
|
@@ -4,6 +4,8 @@ class Fluent::AddFilter < Fluent::Filter
|
|
4
4
|
Fluent::Plugin.register_filter('add', self)
|
5
5
|
|
6
6
|
config_param :uuid, :bool, :default => false
|
7
|
+
config_param :uuid_key, :string, :default => 'uuid'
|
8
|
+
|
7
9
|
def initialize
|
8
10
|
super
|
9
11
|
end
|
@@ -28,7 +30,7 @@ class Fluent::AddFilter < Fluent::Filter
|
|
28
30
|
record[k] = v
|
29
31
|
end
|
30
32
|
if @uuid
|
31
|
-
record[
|
33
|
+
record[@uuid_key] = SecureRandom.uuid.upcase
|
32
34
|
end
|
33
35
|
record
|
34
36
|
end
|
@@ -10,6 +10,7 @@ class Fluent::AddOutput < Fluent::Output
|
|
10
10
|
|
11
11
|
config_param :add_tag_prefix, :string, :default => 'greped'
|
12
12
|
config_param :uuid, :bool, :default => false
|
13
|
+
config_param :uuid_key, :string, :default => 'uuid'
|
13
14
|
|
14
15
|
def initialize
|
15
16
|
super
|
@@ -45,7 +46,7 @@ class Fluent::AddOutput < Fluent::Output
|
|
45
46
|
record[k] = v
|
46
47
|
end
|
47
48
|
if @uuid
|
48
|
-
record[
|
49
|
+
record[@uuid_key] = SecureRandom.uuid.upcase
|
49
50
|
end
|
50
51
|
router.emit(emit_tag, time, record)
|
51
52
|
end
|
@@ -49,6 +49,16 @@ class AddFilterTest < Test::Unit::TestCase
|
|
49
49
|
end
|
50
50
|
assert d.filtered_as_array[0][2].has_key?('uuid')
|
51
51
|
|
52
|
+
d.run
|
53
|
+
end
|
54
|
+
def test_uuid_key
|
55
|
+
d = create_driver("#{CONFIG_UU}\nuuid_key test_uuid")
|
56
|
+
|
57
|
+
d.run do
|
58
|
+
d.emit("a" => 1)
|
59
|
+
end
|
60
|
+
assert d.filtered_as_array[0][2].has_key?('test_uuid')
|
61
|
+
|
52
62
|
d.run
|
53
63
|
end
|
54
64
|
end
|
data/test/plugin/test_out_add.rb
CHANGED
@@ -53,6 +53,16 @@ class AddOutputTest < Test::Unit::TestCase
|
|
53
53
|
end
|
54
54
|
assert d.records[0].has_key?('uuid')
|
55
55
|
|
56
|
+
d.run
|
57
|
+
end
|
58
|
+
def test_uuid_key
|
59
|
+
d = create_driver("#{CONFIG_UU}\nuuid_key test_uuid")
|
60
|
+
|
61
|
+
d.run do
|
62
|
+
d.emit("a" => 1)
|
63
|
+
end
|
64
|
+
assert d.records[0].has_key?('test_uuid')
|
65
|
+
|
56
66
|
d.run
|
57
67
|
end
|
58
68
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-add
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yu yamada
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|