fluent-plugin-mongo 1.2.1 → 1.2.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/.travis.yml +2 -1
- data/ChangeLog +4 -0
- data/VERSION +1 -1
- data/fluent-plugin-mongo.gemspec +1 -1
- data/lib/fluent/plugin/out_mongo.rb +3 -2
- data/test/plugin/test_out_mongo.rb +21 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eedc0d2a61f67e0ef0e8e4b36066e1e0491d263d
|
4
|
+
data.tar.gz: d4bec2e33837adc3dda2a54cfe270ac82f6ad805
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1b9d8b626bd916c3837465430535bb598487cf3742bb52da05b28ca13198d0b98591a1c399923426e59c15f35cb4b47c5a53e23630555c532854b827dbbb6e1
|
7
|
+
data.tar.gz: '085554829eaa6becd079dafa4bbc61ad6f9122f93aba4c39e9f2eb0d8f186e37e0a2ae775cb32c71af4351ac24166eb5b4eec4ed764202fa8858e1183176cd05'
|
data/.travis.yml
CHANGED
data/ChangeLog
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.2
|
data/fluent-plugin-mongo.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
gem.require_paths = ['lib']
|
19
19
|
|
20
|
-
gem.add_dependency "fluentd", [">= 0.14.
|
20
|
+
gem.add_dependency "fluentd", [">= 0.14.22", "< 2"]
|
21
21
|
gem.add_runtime_dependency "mongo", "~> 2.6.0"
|
22
22
|
gem.add_development_dependency "rake", ">= 0.9.2"
|
23
23
|
gem.add_development_dependency "simplecov", ">= 0.5.4"
|
@@ -172,8 +172,9 @@ module Fluent::Plugin
|
|
172
172
|
end
|
173
173
|
|
174
174
|
def write(chunk)
|
175
|
-
collection_name = extract_placeholders(@collection, chunk
|
176
|
-
|
175
|
+
collection_name = extract_placeholders(@collection, chunk)
|
176
|
+
# In connection_string case, we shouldn't handle extract_placeholers for @database.
|
177
|
+
database_name = extract_placeholders(@database, chunk) unless @connection_string
|
177
178
|
operate(database_name, format_collection_name(collection_name), collect_records(chunk))
|
178
179
|
end
|
179
180
|
|
@@ -183,6 +183,27 @@ class MongoOutputTest < ::Test::Unit::TestCase
|
|
183
183
|
assert_equal(expected, actual_documents)
|
184
184
|
end
|
185
185
|
|
186
|
+
def test_write_with_connection_string
|
187
|
+
d = create_driver(%[
|
188
|
+
@type mongo
|
189
|
+
connection_string mongodb://localhost:#{port}/#{database_name}
|
190
|
+
collection #{collection_name}
|
191
|
+
capped
|
192
|
+
capped_size 100
|
193
|
+
])
|
194
|
+
assert_equal("mongodb://localhost:#{port}/#{database_name}", d.instance.connection_string)
|
195
|
+
assert_nil d.instance.database
|
196
|
+
|
197
|
+
d.run(default_tag: 'test') do
|
198
|
+
emit_documents(d)
|
199
|
+
end
|
200
|
+
actual_documents = get_documents
|
201
|
+
time = event_time("2011-01-02 13:14:15 UTC")
|
202
|
+
expected = [{'a' => 1, d.instance.inject_config.time_key => Time.at(time).localtime},
|
203
|
+
{'a' => 2, d.instance.inject_config.time_key => Time.at(time).localtime}]
|
204
|
+
assert_equal(expected, actual_documents)
|
205
|
+
end
|
206
|
+
|
186
207
|
class WriteWithCollectionPlaceholder < self
|
187
208
|
def setup
|
188
209
|
@tag = 'custom'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-mongo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro Nakagawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.14.
|
19
|
+
version: 0.14.22
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '2'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.14.
|
29
|
+
version: 0.14.22
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '2'
|