fluent-plugin-mongo 0.6.6 → 0.6.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.
- data/ChangeLog +108 -0
- data/README.rdoc +9 -2
- data/VERSION +1 -1
- data/lib/fluent/plugin/out_mongo.rb +13 -7
- data/test/plugin/out_mongo.rb +4 -1
- metadata +15 -14
data/ChangeLog
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
|
2
|
+
Release 0.6.6 - 2012/03/01
|
3
|
+
|
4
|
+
* Update mongo gem 1.5.2 -> 1.6.0 or later
|
5
|
+
* Move buffer_chunk_limit checking from configure to start
|
6
|
+
|
7
|
+
|
8
|
+
Release 0.6.5 - 2012/02/27
|
9
|
+
|
10
|
+
* fix "mongo_replset unexpectedly requires 'host' in configuration"
|
11
|
+
https://github.com/fluent/fluent-plugin-mongo/issues/9
|
12
|
+
|
13
|
+
|
14
|
+
Release 0.6.4 - 2012/02/16
|
15
|
+
|
16
|
+
* Add 'disable_collection_check' parameter
|
17
|
+
* Fix mongod_version bug
|
18
|
+
|
19
|
+
|
20
|
+
Release 0.6.3 - 2012/02/08
|
21
|
+
|
22
|
+
* Add authentication support to input / output plugins
|
23
|
+
https://github.com/fluent/fluent-plugin-mongo/pull/8
|
24
|
+
|
25
|
+
|
26
|
+
Release 0.6.2 - 2012/01/23
|
27
|
+
|
28
|
+
* Add :safe to Connection#new options
|
29
|
+
https://github.com/fluent/fluent-plugin-mongo/issues/7
|
30
|
+
* out_mongo_tag_collection renamed to out_mongo_tag_mapped
|
31
|
+
|
32
|
+
|
33
|
+
Release 0.6.1 - 2012/01/17
|
34
|
+
|
35
|
+
* Add mongo_replset explanation to README
|
36
|
+
|
37
|
+
|
38
|
+
Release 0.6.0 - 2012/01/16
|
39
|
+
|
40
|
+
* Add mongo_replset for Replica Set
|
41
|
+
* out_mongo_tag_collection merged into out_mongo.
|
42
|
+
Please use tag_mapped mode.
|
43
|
+
* Support invalid documets handling
|
44
|
+
|
45
|
+
|
46
|
+
Release 0.5.3 - 2011/12/20
|
47
|
+
|
48
|
+
* Fix "use format time argument when record to mongodb"
|
49
|
+
https://github.com/fluent/fluent-plugin-mongo/pull/6
|
50
|
+
|
51
|
+
|
52
|
+
Release 0.5.2 - 2011/11/29
|
53
|
+
|
54
|
+
* Fix mongod_version
|
55
|
+
* Fix "configure of ouput plugins raises an exception when mongod is down"
|
56
|
+
https://github.com/fluent/fluent-plugin-mongo/issues/4
|
57
|
+
|
58
|
+
|
59
|
+
Release 0.5.1 - 2011/11/26
|
60
|
+
|
61
|
+
* Fix typo
|
62
|
+
|
63
|
+
|
64
|
+
Release 0.5.0 - 2011/11/26
|
65
|
+
|
66
|
+
* Jeweler to Bundler
|
67
|
+
* Add in_mongo_tail
|
68
|
+
* Add out_mongo_tag_collection
|
69
|
+
* Add default 'collection' configuration to mongo_tag_collection
|
70
|
+
* Update the version of dependency modules
|
71
|
+
* Fix "MongoDB and Ruby-Driver have a size limit of insert operation."
|
72
|
+
https://github.com/fluent/fluent-plugin-mongo/issues/3
|
73
|
+
|
74
|
+
|
75
|
+
Release 0.4.0 - 2011/10/16
|
76
|
+
|
77
|
+
* Support fluentd 0.10.1
|
78
|
+
* Add out_mongo.rb test
|
79
|
+
|
80
|
+
|
81
|
+
Release 0.3.1 - 2011/10/05
|
82
|
+
|
83
|
+
* Add mongo-tail tool
|
84
|
+
https://github.com/fluent/fluent-plugin-mongo/issues/1
|
85
|
+
|
86
|
+
|
87
|
+
Release 0.3.0 - 2011/10/03
|
88
|
+
|
89
|
+
* Add mongo_backup
|
90
|
+
|
91
|
+
|
92
|
+
Release 0.2.1 - 2011/10/02
|
93
|
+
|
94
|
+
* Fix mongo dependency
|
95
|
+
* Fix typo
|
96
|
+
* Fix configuration parsing
|
97
|
+
* Replace MongoBuffer with MongoOutput's <store>
|
98
|
+
* Fix duplicated insert to backup
|
99
|
+
|
100
|
+
|
101
|
+
Release 0.2.0 - 2011/09/28
|
102
|
+
|
103
|
+
* MongoOutput becomes BufferedOutput
|
104
|
+
|
105
|
+
|
106
|
+
Release 0.1.0 - 2011/09/28
|
107
|
+
|
108
|
+
* Add out_mongo
|
data/README.rdoc
CHANGED
@@ -146,7 +146,7 @@ Use _mongo_tail_ type in source.
|
|
146
146
|
|
147
147
|
Fluentd event sometimes has an invalid record as a BSON.
|
148
148
|
In such case, Mongo plugin marshals an invalid record using Marshal.dump
|
149
|
-
and re-inserts its to same collection.
|
149
|
+
and re-inserts its to same collection as a binary.
|
150
150
|
|
151
151
|
If passed following invalid record:
|
152
152
|
|
@@ -154,11 +154,18 @@ If passed following invalid record:
|
|
154
154
|
|
155
155
|
then Mongo plugin converts this record to following format:
|
156
156
|
|
157
|
-
{"__broken_data": Marshal.dump result of {"key1": "invalid value", "key2": "valid value"}, "time": ISODate("2012-01-15T21:09:53Z") }
|
157
|
+
{"__broken_data": BinData(0, Marshal.dump result of {"key1": "invalid value", "key2": "valid value"}), "time": ISODate("2012-01-15T21:09:53Z") }
|
158
158
|
|
159
159
|
Mongo-Ruby-Driver cannot detect an invalid attribute,
|
160
160
|
so Mongo plugin marshals all attributes excluding Fluentd keys("tag_key" and "time_key").
|
161
161
|
|
162
|
+
You can deserialize broken data using Mongo and Marshal.load. Sample code is below:
|
163
|
+
|
164
|
+
# _collection_ is an instance of Mongo::Collection
|
165
|
+
collection.find({'__broken_data' => {'$exists' => true}}).each do |doc|
|
166
|
+
p Marshal.load(doc['__broken_data'].to_s) #=> {"key1": "invalid value", "key2": "valid value"}
|
167
|
+
end
|
168
|
+
|
162
169
|
If you want to ignore an invalid record, set _true_ to _ignore_invalid_record_ parameter in match.
|
163
170
|
|
164
171
|
<match forward.*>
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.7
|
@@ -18,7 +18,7 @@ class MongoOutput < BufferedOutput
|
|
18
18
|
config_param :host, :string, :default => 'localhost'
|
19
19
|
config_param :port, :integer, :default => 27017
|
20
20
|
config_param :ignore_invalid_record, :bool, :default => false
|
21
|
-
config_param :disable_collection_check, :bool, :default =>
|
21
|
+
config_param :disable_collection_check, :bool, :default => nil
|
22
22
|
config_param :safe, :bool, :default => true
|
23
23
|
|
24
24
|
# tag mapping mode
|
@@ -40,7 +40,12 @@ class MongoOutput < BufferedOutput
|
|
40
40
|
def configure(conf)
|
41
41
|
super
|
42
42
|
|
43
|
-
|
43
|
+
if conf.has_key?('tag_mapped')
|
44
|
+
@tag_mapped = true
|
45
|
+
@disable_collection_check = true if @disable_collection_check.nil?
|
46
|
+
else
|
47
|
+
@disable_collection_check = false if @disable_collection_check.nil?
|
48
|
+
end
|
44
49
|
raise ConfigError, "normal mode requires collection parameter" if !@tag_mapped and !conf.has_key?('collection')
|
45
50
|
|
46
51
|
if remove_tag_prefix = conf['remove_tag_prefix']
|
@@ -128,7 +133,7 @@ class MongoOutput < BufferedOutput
|
|
128
133
|
new_record = {}
|
129
134
|
new_record[@tag_key] = record.delete(@tag_key) if @include_tag_key
|
130
135
|
new_record[@time_key] = record.delete(@time_key)
|
131
|
-
new_record[BROKEN_DATA_KEY] = Marshal.dump(record)
|
136
|
+
new_record[BROKEN_DATA_KEY] = BSON::Binary.new(Marshal.dump(record))
|
132
137
|
new_record
|
133
138
|
}
|
134
139
|
collection.insert(converted_records) # Should create another collection like name_broken?
|
@@ -158,11 +163,12 @@ class MongoOutput < BufferedOutput
|
|
158
163
|
return @clients[collection_name] if @clients[collection_name]
|
159
164
|
|
160
165
|
@db ||= get_connection
|
161
|
-
if @db.collection_names.include?(collection_name)
|
166
|
+
if @db.collection_names.include?(collection_name)
|
162
167
|
collection = @db.collection(collection_name)
|
163
|
-
unless @
|
164
|
-
|
165
|
-
|
168
|
+
unless @disable_collection_check
|
169
|
+
unless @collection_options[:capped] == collection.capped? # TODO: Verify capped configuration
|
170
|
+
raise ConfigError, "New configuration is different from existing collection"
|
171
|
+
end
|
166
172
|
end
|
167
173
|
else
|
168
174
|
collection = @db.create_collection(collection_name, @collection_options)
|
data/test/plugin/out_mongo.rb
CHANGED
@@ -54,7 +54,10 @@ class MongoOutputTest < Test::Unit::TestCase
|
|
54
54
|
assert_equal('fluenter', d.instance.host)
|
55
55
|
assert_equal(27018, d.instance.port)
|
56
56
|
assert_equal({:capped => true, :size => 100}, d.instance.collection_options)
|
57
|
-
assert_equal(
|
57
|
+
assert_equal(33554432, d.instance.instance_variable_get(:@buffer).buffer_chunk_limit)
|
58
|
+
# buffer_chunk_limit moved from configure to start
|
59
|
+
# I will move this test to correct space after BufferedOutputTestDriver supports start method invoking
|
60
|
+
# assert_equal(Fluent::MongoOutput::LIMIT_BEFORE_v1_8, d.instance.instance_variable_get(:@buffer).buffer_chunk_limit)
|
58
61
|
end
|
59
62
|
|
60
63
|
def test_format
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-mongo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-30 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|
16
|
-
requirement: &
|
16
|
+
requirement: &2153123160 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.10.7
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2153123160
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: mongo
|
27
|
-
requirement: &
|
27
|
+
requirement: &2153105660 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.6.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2153105660
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &2153104360 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.9.2
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2153104360
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: simplecov
|
49
|
-
requirement: &
|
49
|
+
requirement: &2153103260 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.5.4
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2153103260
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rr
|
60
|
-
requirement: &
|
60
|
+
requirement: &2153102160 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: 1.0.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2153102160
|
69
69
|
description: MongoDB plugin for Fluent event collector
|
70
70
|
email: repeatedly@gmail.com
|
71
71
|
executables:
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- .gitmodules
|
78
78
|
- .travis.yml
|
79
79
|
- AUTHORS
|
80
|
+
- ChangeLog
|
80
81
|
- Gemfile
|
81
82
|
- README.rdoc
|
82
83
|
- Rakefile
|
@@ -107,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
108
|
version: '0'
|
108
109
|
segments:
|
109
110
|
- 0
|
110
|
-
hash:
|
111
|
+
hash: 3355529483381375280
|
111
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
113
|
none: false
|
113
114
|
requirements:
|
@@ -116,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
117
|
version: '0'
|
117
118
|
segments:
|
118
119
|
- 0
|
119
|
-
hash:
|
120
|
+
hash: 3355529483381375280
|
120
121
|
requirements: []
|
121
122
|
rubyforge_project:
|
122
123
|
rubygems_version: 1.8.10
|