fluent-plugin-config-expander 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc15b514417365a2c266ae6d9a68fd1230eb9ebf
|
4
|
+
data.tar.gz: 572dcd67b74ad9fd0849cfa91f14b6b51107f235
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbdd8c9de434f924943e781ec51aad1d00e3d796ccf695693452dc261adbd982338f81d9783fcdfb8c5d12d482fbb3b0cf3ed17856b4b51367ba856885cdc172
|
7
|
+
data.tar.gz: 6807998f3d95eea1f7951733f871f3b4575948cb87c0739a79f5eca91837ade83cd00762a7bb9100db3a5ef9417fef765752d0acc4a0b43ecd20abde3ea2881b
|
data/README.md
CHANGED
@@ -5,14 +5,14 @@ This is a plugin for [Fluentd](http://fluentd.org).
|
|
5
5
|
## ConfigExpanderInput, ConfigExpanderOutput
|
6
6
|
|
7
7
|
ConfigExpanderInput, ConfigExpanderFilter and ConfigExpanderOutput plugins provide simple configuration template to write items repeatedly.
|
8
|
-
In
|
8
|
+
In `<config>` section, you can write actual configuration for actual input/filter/output plugin, with special directives for loop controls.
|
9
9
|
|
10
10
|
And also supports built-in placeholders below:
|
11
11
|
* hostname (ex: \_\_HOSTNAME\_\_, \_\_hostname\_\_, ${hostname}, ${HOSTNAME})
|
12
12
|
|
13
13
|
## Configuration
|
14
14
|
|
15
|
-
For all of input, filter and output (for
|
15
|
+
For all of input, filter and output (for `<source>`, `<filter>` and `<match>`), you can use 'config_expander' and its 'for' directive like below:
|
16
16
|
|
17
17
|
<match example.**>
|
18
18
|
@type config_expander
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = "fluent-plugin-config-expander"
|
5
|
-
gem.version = "1.0.
|
5
|
+
gem.version = "1.0.1"
|
6
6
|
gem.authors = ["TAGOMORI Satoshi"]
|
7
7
|
gem.email = ["tagomoris@gmail.com"]
|
8
8
|
gem.description = %q{This plugin provides directives for loop extraction}
|
@@ -38,13 +38,19 @@ class Fluent::Plugin::ConfigExpanderFilter < Fluent::Plugin::Filter
|
|
38
38
|
@plugin.configure(ex)
|
39
39
|
mark_used(@config_config.corresponding_config_element)
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
# hack for https://bugs.ruby-lang.org/issues/12478 in ruby 2.3 or earlier
|
42
|
+
mojule = Module.new do
|
43
|
+
def method_defined?(accessor)
|
44
|
+
methods.include?(accessor.to_sym)
|
45
|
+
end
|
46
|
+
def private_method_defined?(accessor)
|
47
|
+
private_methods.include?(accessor.to_sym)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
self.extend(mojule) unless self.class === Module
|
46
51
|
|
47
|
-
|
48
|
-
@plugin.
|
52
|
+
self.extend SingleForwardable
|
53
|
+
override_methods = @plugin.methods - SingleForwardable.instance_methods - Object.instance_methods
|
54
|
+
def_single_delegators(:@plugin, *override_methods)
|
49
55
|
end
|
50
56
|
end
|
@@ -38,13 +38,19 @@ class Fluent::Plugin::ConfigExpanderInput < Fluent::Plugin::Input
|
|
38
38
|
@plugin.configure(ex)
|
39
39
|
mark_used(@config_config.corresponding_config_element)
|
40
40
|
|
41
|
+
# hack for https://bugs.ruby-lang.org/issues/12478 in ruby 2.3 or earlier
|
42
|
+
mojule = Module.new do
|
43
|
+
def method_defined?(accessor)
|
44
|
+
methods.include?(accessor.to_sym)
|
45
|
+
end
|
46
|
+
def private_method_defined?(accessor)
|
47
|
+
private_methods.include?(accessor.to_sym)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
self.extend(mojule) unless self.class === Module
|
51
|
+
|
41
52
|
self.extend SingleForwardable
|
42
|
-
override_methods =
|
43
|
-
override_methods.uniq!
|
53
|
+
override_methods = @plugin.methods - SingleForwardable.instance_methods - Object.instance_methods
|
44
54
|
def_delegators(:@plugin, *override_methods)
|
45
55
|
end
|
46
|
-
|
47
|
-
def method_missing(name, *args, &block)
|
48
|
-
@plugin.__send__(name, *args, &block)
|
49
|
-
end
|
50
56
|
end
|
@@ -40,13 +40,19 @@ class Fluent::Plugin::ConfigExpanderOutput < Fluent::Plugin::BareOutput
|
|
40
40
|
@plugin.configure(ex)
|
41
41
|
mark_used(@config_config.corresponding_config_element)
|
42
42
|
|
43
|
+
# hack for https://bugs.ruby-lang.org/issues/12478 in ruby 2.3 or earlier
|
44
|
+
mojule = Module.new do
|
45
|
+
def method_defined?(accessor)
|
46
|
+
methods.include?(accessor.to_sym)
|
47
|
+
end
|
48
|
+
def private_method_defined?(accessor)
|
49
|
+
private_methods.include?(accessor.to_sym)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
self.extend(mojule) unless self.class === Module
|
53
|
+
|
43
54
|
self.extend SingleForwardable
|
44
|
-
override_methods =
|
45
|
-
override_methods.uniq!
|
55
|
+
override_methods = @plugin.methods - SingleForwardable.instance_methods - Object.instance_methods
|
46
56
|
def_delegators(:@plugin, *override_methods)
|
47
57
|
end
|
48
|
-
|
49
|
-
def method_missing(name, *args, &block)
|
50
|
-
@plugin.__send__(name, *args, &block)
|
51
|
-
end
|
52
58
|
end
|