fluent-plugin-consul 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5a83cabdee56c95a05a17511e58376076356884
4
- data.tar.gz: b0c8555f1b687c7b662a47b78f04b44297a55124
3
+ metadata.gz: 481e9c85e1286760edeffae90e4ccddb09318010
4
+ data.tar.gz: 2e9f44cf977e250bac9644de9f264a287565de29
5
5
  SHA512:
6
- metadata.gz: a37c6dbfe10a1fbc2cdff92d03190d755ef9d7db1d9c0d7d68ac7de4c77ffae9e7e398460de17a6aa31c59e347e630197a24db5553dc9392686ba64a62757f43
7
- data.tar.gz: acd00bf1f706a5f1a5327405941fbe8307cf166106b92e2e57e32cdf8286e3d037740dec3b1a1ba5d091e0cae048ee0963261dc5de195d153821b4d63d68e4d6
6
+ metadata.gz: 8b950481eebdea394d68ce01862b8c04c0ac247c71dae96cc359e78d819479861780f62efe2c4c1c06ea35e3672a29f3fa0fb63da49c351d4158c516ea90b025
7
+ data.tar.gz: 6ab2226bbbb55bb5e6738a9360f0f8e8e2b20eddada462b4ea6a5871a693e88b13dd6cba2872414b8477c5ff70b0143c5025de25c079b25efc3567108b0ea4cb
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
- ## v0.0.1 2014/xx/xx
1
+ ## v0.0.2 2014/11/26
2
+ - Use msgpack
3
+ - Fix bugs
4
+
5
+ ## v0.0.1 2014/11/26
2
6
 
3
7
  - Initial release
data/README.md CHANGED
@@ -4,5 +4,25 @@ fluent-plugin-consul store Fluentd event to Consul Key/Value Storage
4
4
 
5
5
  ## Installing
6
6
 
7
- to be uploaded on Rubygems
7
+ ```
8
+ gem install fluent-plugin-consul
9
+ ```
8
10
 
11
+ ## Configuration
12
+ example configuration
13
+
14
+ ```
15
+ <store>
16
+ type consul
17
+ consul_uri http://localhost:8500 # default
18
+ kv_prefix fluentd # default
19
+ </store>
20
+ ```
21
+
22
+ ## Storing to Consul
23
+ for example, input data is
24
+ - tag: debug.test
25
+ - record: {"json":"message"}
26
+
27
+ stored Key/Value Storage of Consul
28
+ - {kv_prefix}/debug.test/record/json: message
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-consul"
7
- spec.version = "0.0.1"
7
+ spec.version = "0.0.2"
8
8
  spec.authors = ["foostan"]
9
9
  spec.email = ["ks@fstn.jp"]
10
10
  spec.summary = %q{Store Fluentd event to Consul Key/Value Storage}
@@ -19,14 +19,14 @@ module Fluent
19
19
  end
20
20
 
21
21
  def format(tag, time, record)
22
- { tag => { time: time, record: record } }.to_json
22
+ [tag, time, record].to_msgpack
23
23
  end
24
24
 
25
25
  def write(chunk)
26
- data = JSON.parse(chunk.read)
27
-
28
- consul_kvs_fmt(data).each do |kv|
29
- ::Diplomat.put(@kv_prefix + kv[:key].to_s, kv[:value].to_s)
26
+ chunk.msgpack_each do |tag, time, record|
27
+ consul_kvs_fmt(record).each do |kv|
28
+ ::Diplomat.put(@kv_prefix + '/' + tag + kv[:key].to_s, kv[:value].to_s)
29
+ end
30
30
  end
31
31
  end
32
32
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-consul
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - foostan