fluent-plugin-record-reformer 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c27a9bd39e4b37a91f5cfaa52afa8fe63b759cd4
4
- data.tar.gz: f7847b8ad017df0871c32dc82ca5a87949080bc6
3
+ metadata.gz: 6215d33a2b111ebb725f18a0e7c005c3ac61941d
4
+ data.tar.gz: 9ae28141af77da97e9f1d184a64573114e22c1ad
5
5
  SHA512:
6
- metadata.gz: 7ad34f1d7fa04e2393c5513bf1821c53572eb4d5de13635bdb00d0aea408996301c59e19ecdb48f0d1640c421d2c88c0b378ba997ce641f0d5feaced6e05cae6
7
- data.tar.gz: 3ec3479c687ad1fadb9a0f08ac67225a2c4668440b8b647f3e60a6edb10d44b39a2e5f4a2bf85724a93cfc08642da798a5fe911ed7b10f384fa34460a99f4be2
6
+ metadata.gz: 3e9b89f7c08477689912fefa5766f30fab6dca8083e28932b60ac602dac1f6310cd8953722c69b92d961682cd5eebed36112b09193b874629bdd58c7ecdbbc38
7
+ data.tar.gz: a1c5312176c270143bb9cf8d86b4245917dc5961450938de67953855a26f7327eea9066eda2e1ed7948843322f9424c191f3745776257e207ee56617611a92d0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.0.3 (2013/08/07)
2
+
3
+ Enhancement:
4
+
5
+ * Enable to reform tag
6
+
1
7
  ## 0.0.2 (2013/08/07)
2
8
 
3
9
  Enhancement:
data/README.md CHANGED
@@ -16,7 +16,7 @@ Example:
16
16
 
17
17
  <match foo.**>
18
18
  type record_reformer
19
- output_tag reformed
19
+ output_tag reformed.${tag}
20
20
 
21
21
  hostname ${hostname}
22
22
  tag ${tag}
@@ -33,7 +33,7 @@ foo.bar {"message":"hello world!", "foo":"bar"}
33
33
  then output becomes as below (indented):
34
34
 
35
35
  ```js
36
- reformed {
36
+ reformed.foo.bar {
37
37
  "hostname":"your_hostname",
38
38
  "tag":"foo.bar",
39
39
  "time":"2013-05-01T01:13:14Z",
@@ -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.0.2"
6
+ gem.version = "0.0.3"
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"
@@ -24,7 +24,9 @@ module Fluent
24
24
  def emit(tag, es, chain)
25
25
  tags = tag.split('.')
26
26
  es.each { |time, record|
27
- Engine.emit(@output_tag, time, replace_record(record, tag, tags, Time.at(time)))
27
+ t_time = Time.at(time)
28
+ output_tag = expand_placeholder(@output_tag, record, tag, tags, t_time)
29
+ Engine.emit(output_tag, time, replace_record(record, tag, tags, t_time))
28
30
  }
29
31
  chain.next
30
32
  rescue => e
@@ -5,7 +5,7 @@ describe Fluent::RecordReformerOutput do
5
5
  before { Fluent::Test.setup }
6
6
  CONFIG = %[
7
7
  type reformed
8
- output_tag reformed
8
+ output_tag reformed.${tag}
9
9
 
10
10
  hostname ${hostname}
11
11
  tag ${tag}
@@ -23,7 +23,6 @@ describe Fluent::RecordReformerOutput do
23
23
 
24
24
  context "check default" do
25
25
  let(:config) { CONFIG }
26
- its(:output_tag) { should == 'reformed' }
27
26
  end
28
27
  end
29
28
  end
@@ -40,14 +39,14 @@ describe Fluent::RecordReformerOutput do
40
39
  let(:config) { CONFIG }
41
40
  before do
42
41
  Fluent::Engine.stub(:now).and_return(time)
43
- Fluent::Engine.should_receive(:emit).with("reformed", time.to_i, {
42
+ Fluent::Engine.should_receive(:emit).with("reformed.#{tag}", time.to_i, {
44
43
  'foo' => 'bar',
45
44
  'hostname' => hostname,
46
45
  'tag' => tag,
47
46
  'time' => time.strftime('%S'),
48
47
  'message' => "#{hostname} #{tags.last} 1",
49
48
  })
50
- Fluent::Engine.should_receive(:emit).with("reformed", time.to_i, {
49
+ Fluent::Engine.should_receive(:emit).with("reformed.#{tag}", time.to_i, {
51
50
  'foo' => 'bar',
52
51
  'hostname' => hostname,
53
52
  'tag' => tag,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-record-reformer
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
  - Naotoshi Seo
@@ -82,7 +82,7 @@ files:
82
82
  - Rakefile
83
83
  - fluent-plugin-record-reformer.gemspec
84
84
  - lib/fluent/plugin/out_record_reformer.rb
85
- - spec/out_record_expander_spec.rb
85
+ - spec/out_record_reformer_spec.rb
86
86
  - spec/spec_helper.rb
87
87
  homepage: https://github.com/sonots/fluent-plugin-record-reformer
88
88
  licenses:
@@ -109,5 +109,5 @@ signing_key:
109
109
  specification_version: 4
110
110
  summary: Output filter plugin for reforming each event record
111
111
  test_files:
112
- - spec/out_record_expander_spec.rb
112
+ - spec/out_record_reformer_spec.rb
113
113
  - spec/spec_helper.rb