fluent-plugin-storage-mongo 0.0.2 → 0.0.3

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: '0820d51e381332916791bb09a0ec68de66c12b7e'
4
- data.tar.gz: 53bd8cfc573fbdec11d27a324693b2aea144d53e
3
+ metadata.gz: 040e80ab6cb22f6d11793f09941ad972059deac4
4
+ data.tar.gz: 3d441a7770deb581670e48c6ed8ee45516596cad
5
5
  SHA512:
6
- metadata.gz: f57e509e0558c7bcded908dd3b0763c5172b6eb4cd67f1bf079a8a0a47e3eaa36272e79cb734e1012bd1fd79edab93c5951110453917e6e961ac1b63dcc794d2
7
- data.tar.gz: 4efd90933307203bdbc86696ae6ad15e81fb1ed564957665cdf78edda57f16cac995d5955ee40e8075dc107f89d7b9de6fc0afeec0355d2394b28e79c2287a2b
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.2"
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.2
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-17 00:00:00.000000000 Z
11
+ date: 2017-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler