fluent-plugin-add 0.0.1 → 0.0.2
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/README.md +17 -11
- data/fluent-plugin-add.gemspec +1 -1
- data/lib/fluent/plugin/out_add.rb +3 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c07c622d7615388bb1d231d36563598500848bfb
|
4
|
+
data.tar.gz: 8bdde6e0b38c7184c5ad5b20024d707b3de4bbef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a97b9c757f549799731c52b29bee1ce8d31612ef15cdbe694b2c1182a9e6862f358e57b3c60e61b5b044d1172b4c8f418eff1abf4bd13314635335ce200894cf
|
7
|
+
data.tar.gz: 8d4fee42405efcd78998de403e99d25c0c210da5e484f9d505565849298141865b51919bc4b0be031c4b25a09866edb5071aa83ced7c05ef0048a1541fbfc95e
|
data/README.md
CHANGED
@@ -1,24 +1,27 @@
|
|
1
|
-
#
|
1
|
+
# fluent-plugin-add
|
2
2
|
|
3
|
-
TODO: Write a gem description
|
4
3
|
|
5
4
|
## Installation
|
6
5
|
|
7
|
-
Add this line to your application's Gemfile:
|
8
6
|
|
9
|
-
gem
|
7
|
+
gem install fluent-plugin-add
|
10
8
|
|
11
|
-
|
9
|
+
## Configration
|
12
10
|
|
13
|
-
|
11
|
+
<match test.**>
|
12
|
+
type add
|
13
|
+
add_tag_prefix debug
|
14
|
+
<pair>
|
15
|
+
hoge moge
|
16
|
+
</pair>
|
17
|
+
</match>
|
14
18
|
|
15
|
-
Or install it yourself as:
|
16
19
|
|
17
|
-
|
20
|
+
### Assuming following inputs are coming:
|
21
|
+
test.aa: {"json":"dayo"}
|
22
|
+
### then output bocomes as belows
|
23
|
+
debug.test.aa: {"json":"dayo", "hoge":"moge"}
|
18
24
|
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
TODO: Write usage instructions here
|
22
25
|
|
23
26
|
## Contributing
|
24
27
|
|
@@ -27,3 +30,6 @@ TODO: Write usage instructions here
|
|
27
30
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
31
|
4. Push to the branch (`git push origin my-new-feature`)
|
29
32
|
5. Create new Pull Request
|
33
|
+
|
34
|
+
## Copyright
|
35
|
+
Copyright (c) 2013 yu-yamada
|
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.2"
|
9
9
|
spec.authors = ["yu yamada"]
|
10
10
|
spec.email = ["yu.yamada@outlook.com"]
|
11
11
|
spec.description = %q{Output filter plugin to count messages that matches specified conditions}
|
@@ -2,8 +2,6 @@ require 'pp'
|
|
2
2
|
class Fluent::AddOutput < Fluent::Output
|
3
3
|
Fluent::Plugin.register_output('add', self)
|
4
4
|
|
5
|
-
config_param :key, :string
|
6
|
-
config_param :value, :string, :default => nil
|
7
5
|
config_param :add_tag_prefix, :string, :default => 'greped'
|
8
6
|
|
9
7
|
def initialize
|
@@ -13,8 +11,8 @@ class Fluent::AddOutput < Fluent::Output
|
|
13
11
|
def configure(conf)
|
14
12
|
super
|
15
13
|
|
16
|
-
@key = @key.to_s
|
17
|
-
@value = @value.to_s
|
14
|
+
# @key = @key.to_s
|
15
|
+
# @value = @value.to_s
|
18
16
|
@tag_prefix = "#{@add_tag_prefix}."
|
19
17
|
@add_hash = Hash.new
|
20
18
|
|
@@ -37,7 +35,7 @@ class Fluent::AddOutput < Fluent::Output
|
|
37
35
|
emit_tag = @tag_proc.call(tag)
|
38
36
|
|
39
37
|
es.each do |time,record|
|
40
|
-
record[@key] = @value
|
38
|
+
# record[@key] = @value
|
41
39
|
@add_hash.each do |k,v|
|
42
40
|
record[k] = v
|
43
41
|
end
|