fluent-plugin-couch 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +10 -4
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/lib/fluent/plugin/out_couch.rb +6 -1
- metadata +16 -5
data/README.rdoc
CHANGED
@@ -25,9 +25,15 @@ Store fluent-event as CouchDB Document to CouchDB database.
|
|
25
25
|
database fluent
|
26
26
|
|
27
27
|
# following attibutes are optional
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
|
29
|
+
host fluenter #default:localhost
|
30
|
+
port 10000 #default:5984
|
31
|
+
protocol https #default:http
|
32
|
+
|
33
|
+
update_docs true #default:false
|
34
|
+
doc_key_field doc_id #default:nil
|
35
|
+
|
36
|
+
refresh_view_index viewname #default:nil
|
31
37
|
|
32
38
|
# for Basic Authentication (optional)
|
33
39
|
user odagiri
|
@@ -39,7 +45,7 @@ Store fluent-event as CouchDB Document to CouchDB database.
|
|
39
45
|
== TODO
|
40
46
|
=== More configuration
|
41
47
|
=== Feature
|
42
|
-
*
|
48
|
+
*
|
43
49
|
|
44
50
|
== Tool
|
45
51
|
|
data/Rakefile
CHANGED
@@ -14,6 +14,7 @@ begin
|
|
14
14
|
gemspec.require_paths = ["lib"]
|
15
15
|
gemspec.add_dependency "fluentd", "~> 0.10.0"
|
16
16
|
gemspec.add_dependency "couchrest", "~> 1.1.2"
|
17
|
+
gemspec.add_dependency "jsonpath", "~> 0.4.2"
|
17
18
|
gemspec.test_files = Dir["test/**/*.rb"]
|
18
19
|
gemspec.files = Dir["lib/**/*", "test/**/*.rb"] + %w[VERSION AUTHORS Rakefile]
|
19
20
|
gemspec.executables = []
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.0
|
@@ -21,11 +21,13 @@ module Fluent
|
|
21
21
|
|
22
22
|
config_param :update_docs, :bool, :default => false
|
23
23
|
config_param :doc_key_field, :string, :default => nil
|
24
|
+
config_param :doc_key_jsonpath, :string, :default => nil
|
24
25
|
|
25
26
|
def initialize
|
26
27
|
super
|
27
28
|
|
28
29
|
require 'msgpack'
|
30
|
+
require 'jsonpath'
|
29
31
|
Encoding.default_internal = 'UTF-8'
|
30
32
|
require 'couchrest'
|
31
33
|
Encoding.default_internal = 'ASCII-8BIT'
|
@@ -62,7 +64,10 @@ module Fluent
|
|
62
64
|
def write(chunk)
|
63
65
|
records = []
|
64
66
|
chunk.msgpack_each {|record|
|
65
|
-
|
67
|
+
|
68
|
+
id = record[@doc_key_field]
|
69
|
+
id = JsonPath.new(@doc_key_jsonpath).first(record) if id.nil? && !@doc_key_jsonpath.nil?
|
70
|
+
record['_id'] = id unless id.nil?
|
66
71
|
records << record
|
67
72
|
}
|
68
73
|
unless @update_docs
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-couch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-13 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|
16
|
-
requirement: &
|
16
|
+
requirement: &70165018951360 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.10.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70165018951360
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: couchrest
|
27
|
-
requirement: &
|
27
|
+
requirement: &70165018950440 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,18 @@ dependencies:
|
|
32
32
|
version: 1.1.2
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70165018950440
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: jsonpath
|
38
|
+
requirement: &70165018949440 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 0.4.2
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70165018949440
|
36
47
|
description:
|
37
48
|
email: ixixizko@gmail.com
|
38
49
|
executables: []
|