fluent-plugin-filter-geoip 0.4.0 → 0.5.0

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: 22375e434125aebe8277c4d7fa7f514eb7966509
4
- data.tar.gz: 1e3bbf3d9fdd1d1f7346fcfa9d86363bdf535525
3
+ metadata.gz: a5523f7842532f6fbcdbb0f53bfcfc6aeab71472
4
+ data.tar.gz: 9a9b2fcc94bbdbb17dde860b8d2aac6b9cda64e8
5
5
  SHA512:
6
- metadata.gz: 22fdd539a5ac12301846a33c52e160e1a5dfbdb92765aff8b08fd9bd1cfe40bfaab483844a249be5f856c7249b9268a85a25767c126ff2214a0bd503db09f767
7
- data.tar.gz: e1e88ac9eb9b0fdc643cda4cd1fe4fc3103f90d7c0d1f66a32a0bebd787b08f99d94028aa18336ec61c2262eebba40cfca9ad2d640ba390494a813c97adbb9e5
6
+ metadata.gz: f6dd32a6bd3699dbbef1dfe2da3ba581e2b936ceef1f268583fa759b8d35521e8951193434b6ac563c41ecd995ec2f95ca1451feae220ae0bcd281aee0e87bcd
7
+ data.tar.gz: 635c1a0fc6fdfcdff9120282fa43f17f9b0649b0653ac23a75b9114ab1ce859c3c8349c9549930b8b245d1939338e9b8695bb54aee97c7862e27cdf8b75eadbf
@@ -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-filter-geoip"
7
- spec.version = "0.4.0"
7
+ spec.version = "0.5.0"
8
8
  spec.authors = ["Minoru Osuka"]
9
9
  spec.email = ["minoru.osuka@gmail.com"]
10
10
 
@@ -119,6 +119,7 @@ module Fluent
119
119
  end
120
120
 
121
121
  if geoip.found? then
122
+ record.merge!({@output_field => {}})
122
123
  if @continent then
123
124
  continent_hash = {}
124
125
 
@@ -139,7 +140,7 @@ module Fluent
139
140
  if @flatten then
140
141
  record.merge!(to_flatten(continent_hash, [@output_field, 'continent'], @field_delimiter))
141
142
  else
142
- record[[@output_field, 'continent'].join(@field_delimiter)] = continent_hash.to_json
143
+ record[@output_field].merge!({'continent' => continent_hash})
143
144
  end
144
145
  end
145
146
  end
@@ -164,7 +165,7 @@ module Fluent
164
165
  if @flatten then
165
166
  record.merge!(to_flatten(country_hash, [@output_field, 'country'], @field_delimiter))
166
167
  else
167
- record[[@output_field, 'country'].join(@field_delimiter)] = country_hash.to_json
168
+ record[@output_field].merge!({'country' => country_hash})
168
169
  end
169
170
  end
170
171
  end
@@ -189,7 +190,7 @@ module Fluent
189
190
  if @flatten then
190
191
  record.merge!(to_flatten(city_hash, [@output_field, 'city'], @field_delimiter))
191
192
  else
192
- record[[@output_field, 'city'].join(@field_delimiter)] = city_hash.to_json
193
+ record[@output_field].merge!({'city' => city_hash})
193
194
  end
194
195
  end
195
196
  end
@@ -214,7 +215,7 @@ module Fluent
214
215
  if @flatten then
215
216
  record.merge!(to_flatten(location_hash, [@output_field, 'location'], @field_delimiter))
216
217
  else
217
- record[[@output_field, 'location'].join(@field_delimiter)] = location_hash.to_json
218
+ record[@output_field].merge!({'location' => location_hash})
218
219
  end
219
220
  end
220
221
  end
@@ -230,7 +231,7 @@ module Fluent
230
231
  if @flatten then
231
232
  record.merge!(to_flatten(postal_hash, [@output_field, 'postal'], @field_delimiter))
232
233
  else
233
- record[[@output_field, 'postal'].join(@field_delimiter)] = postal_hash.to_json
234
+ record[@output_field].merge!({'postal' => postal_hash})
234
235
  end
235
236
  end
236
237
  end
@@ -255,7 +256,7 @@ module Fluent
255
256
  if @flatten then
256
257
  record.merge!(to_flatten(registered_country_hash, [@output_field, 'registered_country'], @field_delimiter))
257
258
  else
258
- record[[@output_field, 'registered_country'].join(@field_delimiter)] = registered_country_hash.to_json
259
+ record[@output_field].merge!({'registered_country' => registered_country_hash})
259
260
  end
260
261
  end
261
262
  end
@@ -280,7 +281,7 @@ module Fluent
280
281
  if @flatten then
281
282
  record.merge!(to_flatten(represented_country_hash, [@output_field, 'represented_country'], @field_delimiter))
282
283
  else
283
- record[[@output_field, 'represented_country'].join(@field_delimiter)] = represented_country_hash.to_json
284
+ record[@output_field].merge!({'represented_country' => represented_country_hash})
284
285
  end
285
286
  end
286
287
  end
@@ -320,7 +321,7 @@ module Fluent
320
321
  i = i + 1
321
322
  end
322
323
  else
323
- record[[@output_field, 'subdivisions'].join(@field_delimiter)] = subdivision_arry.to_json
324
+ record[@output_field].merge!({'subdivisions' => subdivision_arry})
324
325
  end
325
326
  end
326
327
  end
@@ -339,14 +340,19 @@ module Fluent
339
340
  if @flatten then
340
341
  record.merge!(to_flatten(traits_hash, [@output_field, 'traits'], @field_delimiter))
341
342
  else
342
- record[[@output_field, 'traits'].join(@field_delimiter)] = traits_hash.to_json
343
+ record[@output_field].merge!({'traits' => traits_hash})
343
344
  end
344
345
  end
345
346
  end
346
347
 
347
348
  if @connection_type then
348
349
  unless geoip.connection_type.nil? then
349
- record[[@output_field, 'connection_type'].join(@field_delimiter)] = geoip.connection_type
350
+ if @flatten then
351
+ #record[[@output_field, 'connection_type'].join(@field_delimiter)] = geoip.connection_type
352
+ record.merge!(to_flatten(geoip.connection_type, [@output_field, 'connection_type'], @field_delimiter))
353
+ else
354
+ record[@output_field].merge!({'connection_type' => geoip.connection_type})
355
+ end
350
356
  end
351
357
  end
352
358
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-filter-geoip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Minoru Osuka