fluent-plugin-mutate_filter 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0664bad26658d5673c81a8bf2a16a009da087d73587b80e376c05a5197fe8b6e
4
- data.tar.gz: 6f7cdc9185ed4978cc003ddea9f98ae7f4e715892b7d7903dcedfa58921931e7
3
+ metadata.gz: 7f03e9c20c201a44d0111d833ce4da6b5e0b34f64766827dc5437ded7c903e42
4
+ data.tar.gz: 0c312602da5ce20a8b5158a575ccd6ee007f5fd37bebfc1d9364a1b27f6aacd7
5
5
  SHA512:
6
- metadata.gz: 94e5be76a90711b400d3027234268e0eddf3f5649c5e5aa7048a3f5a6808a58f0d79b97efd55f69ce4493afe2965ec5bf03f3bafbba26371a90ed43844dae287
7
- data.tar.gz: 5175dfb54f04ca6d03cc512e8dda1fd1835b2913b85ff4c49e238aaa10e0b965dec30380c058ab32d1dd9daadef9f0c31e433979281f345e991d75deb82f0263
6
+ metadata.gz: 4950d5c538b6f85729c4061480f5e6f38ed3add6a064437e7e975c44f112836f0eeaccbf9dfbe6b02417c2a49cb5cf8712e0d37f2f6813b6782334c13bd2e10d
7
+ data.tar.gz: '008a35683b38f797003909330e912ab2a231c30af02d8b2ceb9bd9c99dbe152ef6581259b999d96ca9bc833c152ed1be2f861b1a36733c104677388eb7489af8'
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "fluent-plugin-mutate_filter"
6
- spec.version = "1.0.6"
6
+ spec.version = "1.0.7"
7
7
  spec.authors = ["Jonathan Serafini"]
8
8
  spec.email = ["jonathan@serafini.ca"]
9
9
 
@@ -278,7 +278,7 @@ module Fluent
278
278
  when NilClass
279
279
  next
280
280
  when Hash
281
- @log.error("cannot convert hash", field: field, value: original)
281
+ @log.warn("cannot convert hash", field: field, value: original)
282
282
  when Array
283
283
  event.set(field, original.map{|v| converter.call(v)})
284
284
  else
@@ -307,7 +307,7 @@ module Fluent
307
307
  def convert_boolean(value)
308
308
  return true if value =~ TRUE_REGEX
309
309
  return false if value.empty? || value =~ FALSE_REGEX
310
- @log.error("failed to convert to boolean", value: value)
310
+ @log.warn("failed to convert to boolean", value: value)
311
311
  end
312
312
 
313
313
  # Convert field values to uppercase in the record hash
@@ -325,7 +325,7 @@ module Fluent
325
325
  when String
326
326
  original.upcase! || original
327
327
  else
328
- @log.error("can't uppercase field",
328
+ @log.warn("can't uppercase field",
329
329
  field: field,
330
330
  value: original)
331
331
  original
@@ -348,7 +348,7 @@ module Fluent
348
348
  when String
349
349
  original.downcase! || original
350
350
  else
351
- @log.error("can't lowercase field",
351
+ @log.warn("can't lowercase field",
352
352
  field: field,
353
353
  value: original)
354
354
  original
@@ -365,7 +365,7 @@ module Fluent
365
365
  if value.is_a?(String)
366
366
  event.set(field, value.split(separator))
367
367
  else
368
- @log.error("can't split field",
368
+ @log.warn("can't split field",
369
369
  field: field,
370
370
  value: value)
371
371
  end
@@ -390,6 +390,8 @@ module Fluent
390
390
  next unless bool
391
391
  value = event.get(field)
392
392
  case value
393
+ when NilClass
394
+ next
393
395
  when Array
394
396
  event.set(field, value.map{|s| s.strip})
395
397
  when String
@@ -408,7 +410,7 @@ module Fluent
408
410
  added_field_value = event.get(added_field)
409
411
 
410
412
  if dest_field_value.is_a?(Hash) ^ added_field_value.is_a?(Hash)
411
- @log.error('cannot merge an array and hash',
413
+ @log.warn('cannot merge an array and hash',
412
414
  dest_field: dest_field,
413
415
  added_field: added_field)
414
416
  next
@@ -437,7 +439,7 @@ module Fluent
437
439
  parsed = nil
438
440
 
439
441
  unless value.is_a?(String)
440
- @log.warn("field value cannot be parsed by #{parser}")
442
+ @log.warn("field value cannot be parsed by #{parser}") unless value.nil?
441
443
  next
442
444
  end
443
445
 
@@ -476,7 +478,7 @@ module Fluent
476
478
  if v.is_a?(String)
477
479
  gsub_dynamic_fields(event, v, pattern, replacement)
478
480
  else
479
- @log.error('cannot gsub non Strings',
481
+ @log.warn('cannot gsub non Strings',
480
482
  field: key,
481
483
  value: v)
482
484
  end
@@ -485,8 +487,10 @@ module Fluent
485
487
  when String
486
488
  v = gsub_dynamic_fields(event, value, pattern, replacement)
487
489
  event.set(key, v)
490
+ when NilClass
491
+ next
488
492
  else
489
- @log.error('cannot gsub non Strings', field: key, value: value)
493
+ @log.warn('cannot gsub non Strings', field: key, value: value)
490
494
  end
491
495
  end
492
496
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-mutate_filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Serafini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-19 00:00:00.000000000 Z
11
+ date: 2018-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler