fluent-plugin-storage-mongo 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fluent-plugin-storage-mongo.gemspec +1 -1
- data/lib/fluent/plugin/storage_mongo.rb +9 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 040e80ab6cb22f6d11793f09941ad972059deac4
|
4
|
+
data.tar.gz: 3d441a7770deb581670e48c6ed8ee45516596cad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b4aa8a8239e2aee8455816875e02af5ee3c8a4378ab9ea1a3bb86b21f73df8c3a465e733e553087a58307ec6ea6e3ae74ab59e3ac8202e7c75c24dd81613549
|
7
|
+
data.tar.gz: 3e5e625b305d66c47ca6ed750a0bb3dc21b52490e3818bc38301b16d49341ebf29da0ee5349d671c6f52d5fbad4c5d6b9f606ddc33ede490ad6d0ab8a619f962
|
@@ -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-storage-mongo"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.3"
|
8
8
|
spec.authors = ["Hiroshi Hatake"]
|
9
9
|
spec.email = ["cosmo0920.oucc@gmail.com"]
|
10
10
|
|
@@ -31,6 +31,8 @@ module Fluent
|
|
31
31
|
config_param :replace_dot_in_key_with, :string, default: nil
|
32
32
|
desc "Replace dollar with specified string"
|
33
33
|
config_param :replace_dollar_in_key_with, :string, default: nil
|
34
|
+
desc "Replace _id with specified string"
|
35
|
+
config_param :replace_underbar_id_in_key_with, :string, default: nil
|
34
36
|
|
35
37
|
# SSL connection
|
36
38
|
config_param :ssl, :bool, default: false
|
@@ -98,7 +100,8 @@ module Fluent
|
|
98
100
|
value.merge!(document)
|
99
101
|
end
|
100
102
|
end
|
101
|
-
value.delete('_id')
|
103
|
+
value.delete('_id') # just ignore '_id'
|
104
|
+
|
102
105
|
unless value.is_a?(Hash)
|
103
106
|
log.error "broken content for plugin storage (Hash required: ignored)", type: json.class
|
104
107
|
log.debug "broken content", content: json_string
|
@@ -154,10 +157,13 @@ module Fluent
|
|
154
157
|
|
155
158
|
def format_key(record)
|
156
159
|
if @replace_dot_in_key_with
|
157
|
-
replace_key_of_hash(record, ".", @replace_dot_in_key_with)
|
160
|
+
record = replace_key_of_hash(record, ".", @replace_dot_in_key_with)
|
158
161
|
end
|
159
162
|
if @replace_dollar_in_key_with
|
160
|
-
replace_key_of_hash(record, /^\$/, @replace_dollar_in_key_with)
|
163
|
+
record = replace_key_of_hash(record, /^\$/, @replace_dollar_in_key_with)
|
164
|
+
end
|
165
|
+
if @replace_underbar_id_in_key_with
|
166
|
+
record = replace_key_of_hash(record, /^_id$/, @replace_underbar_id_in_key_with)
|
161
167
|
end
|
162
168
|
record
|
163
169
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-storage-mongo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi Hatake
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|