fluent-plugin-record-reformer 0.6.0 → 0.6.1

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
  SHA1:
3
- metadata.gz: b11c53c3848c8e1f62cb8edbf0791b6d8da44fcc
4
- data.tar.gz: 9d898ccdf04a40be27a8308545fa8c3da2df7a45
3
+ metadata.gz: 905ddbf4748a2a0609648bde025f49bc1959a475
4
+ data.tar.gz: ee4120d718f07dde5793555fd48f9b67bbb89282
5
5
  SHA512:
6
- metadata.gz: d38295f7e65940410aa78551dca912f0cbc40d3eff113fd685face34edd6cad5210d6492316b1fddb33ad80296fb0905bad7032173f2754c2bc941df8a642ff8
7
- data.tar.gz: 54452db122efb3d69883095aef369d2ed13fc0901c259b0d92cff14c1af6af97ca939a048f03697f8a17c682a447ae545244231599186a85523aa1f6ecec10c7
6
+ metadata.gz: c7a72c9c560f8aaf604d2840b53c8d931ee0f79fe57ecb4252f24b09e8d6c909ba6a36f11b2b3b717cefa0141e1187bb752930b17d07ffcb4fb4217207dcaf3a
7
+ data.tar.gz: d8c2436af87363743160312d9e830548306343f5ef39bddeca89637efb03306e381ef13be082659a3ad60b3a00e6aa48979a0b5dc8bd27145ea118050c8d69a9
data/.travis.yml CHANGED
@@ -2,5 +2,6 @@ rvm:
2
2
  - 1.9.3
3
3
  - 2.0.0
4
4
  - 2.1.*
5
+ - 2.2.*
5
6
  gemfile:
6
7
  - Gemfile
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.6.1 (2015/05/10)
2
+
3
+ Enhancements:
4
+
5
+ * Support label routing of Fluentd v0.12
6
+
1
7
  ## 0.6.0 (2015/04/11)
2
8
 
3
9
  Changes:
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = "fluent-plugin-record-reformer"
6
- gem.version = "0.6.0"
6
+ gem.version = "0.6.1"
7
7
  gem.authors = ["Naotoshi Seo"]
8
8
  gem.email = "sonots@gmail.com"
9
9
  gem.homepage = "https://github.com/sonots/fluent-plugin-record-reformer"
@@ -23,6 +23,11 @@ module Fluent
23
23
  define_method("log") { $log }
24
24
  end
25
25
 
26
+ # Define `router` method of v0.12 to support v0.10 or earlier
27
+ unless method_defined?(:router)
28
+ define_method("router") { Fluent::Engine }
29
+ end
30
+
26
31
  def configure(conf)
27
32
  super
28
33
 
@@ -87,7 +92,7 @@ module Fluent
87
92
  es.each {|time, record|
88
93
  last_record = record # for debug log
89
94
  new_tag, new_record = reform(@tag, time, record, placeholders)
90
- Engine.emit(new_tag, time, new_record) if new_tag
95
+ router.emit(new_tag, time, new_record) if new_tag
91
96
  }
92
97
  chain.next
93
98
  rescue => e
@@ -397,8 +397,9 @@ class RecordReformerOutputTest < Test::Unit::TestCase
397
397
  d = create_driver(config, use_v1)
398
398
  message = {"@timestamp" => "foo"}
399
399
  d.run { d.emit(message, @time) }
400
- reformed = d.emits.first[2]
401
- assert_equal reformed["foo"], message["@timestamp"]
400
+ d.emits.each do |(tag, time, record)|
401
+ assert_equal message["@timestamp"], record["foo"]
402
+ end
402
403
  end
403
404
 
404
405
  test 'expand fields starting with @ (enable_ruby yes)' do
@@ -412,8 +413,9 @@ class RecordReformerOutputTest < Test::Unit::TestCase
412
413
  d = create_driver(config, use_v1)
413
414
  message = {"@timestamp" => "foo"}
414
415
  d.run { d.emit(message, @time) }
415
- reformed = d.emits.first[2]
416
- assert_equal reformed["foo"], message["@timestamp"]
416
+ d.emits.each do |(tag, time, record)|
417
+ assert_equal message["@timestamp"], record["foo"]
418
+ end
417
419
  end
418
420
  end
419
421
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-record-reformer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-11 00:00:00.000000000 Z
11
+ date: 2015-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd