fluent-plugin-yohoushi 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/fluent-plugin-yohoushi.gemspec +1 -1
- data/lib/fluent/plugin/out_yohoushi.rb +2 -2
- data/spec/out_yohoushi_spec.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d33e56754f4290c20f7b06b38587f735fc86c2f
|
4
|
+
data.tar.gz: f5e963e6b9fa7bb2ff74c8c63d551906277da04f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7c1f30ae26ff1025657de6b2812a88e46785e510b69a3d0e98aca8a51065349a481c6551e23b643c4d6d6ec9db2e30218fcbd767ea89d50d4a7a64db9ac7a94
|
7
|
+
data.tar.gz: 667ae677f9de049f407561f5425c945748189581b53bd65282fac15546c261150658d2af240994519a4838c06db0650e155e384e5690799d08d23cbee62f1515
|
data/CHANGELOG.md
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "fluent-plugin-yohoushi"
|
6
|
-
s.version = "0.0.
|
6
|
+
s.version = "0.0.5"
|
7
7
|
s.authors = ["Naotoshi Seo"]
|
8
8
|
s.email = ["sonots@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/sonots/fluent-plugin-yohoushi"
|
@@ -170,7 +170,7 @@ class Fluent::YohoushiOutput < Fluent::Output
|
|
170
170
|
attr_reader :placeholders
|
171
171
|
|
172
172
|
def prepare_placeholders(time, record, opts)
|
173
|
-
placeholders = { '${time}' => time.to_s }
|
173
|
+
placeholders = { '${time}' => Time.at(time).to_s }
|
174
174
|
record.each {|key, val| placeholders.store("${#{key}}", val) }
|
175
175
|
|
176
176
|
opts.each do |key, val|
|
@@ -206,7 +206,7 @@ class Fluent::YohoushiOutput < Fluent::Output
|
|
206
206
|
# @param [Hash] opts others
|
207
207
|
def prepare_placeholders(time, record, opts)
|
208
208
|
struct = UndefOpenStruct.new(record)
|
209
|
-
struct.time = time
|
209
|
+
struct.time = Time.at(time)
|
210
210
|
opts.each {|key, val| struct.__send__("#{key}=", val) }
|
211
211
|
@placeholders = struct
|
212
212
|
end
|
data/spec/out_yohoushi_spec.rb
CHANGED
@@ -145,14 +145,14 @@ describe Fluent::YohoushiOutput do
|
|
145
145
|
let(:time) { Time.now.to_i }
|
146
146
|
let(:record) { { 'foo_count' => "1" } }
|
147
147
|
let(:emit) { driver.run { driver.emit(record, time) } }
|
148
|
-
let(:expected_path) {
|
148
|
+
let(:expected_path) { "/fluent/error/fluent.error/1/foo_count/#{Time.at(time)}" }
|
149
149
|
let(:expected_value) { '1' }
|
150
150
|
before { driver.instance.should_receive(:post).with(expected_path, expected_value) }
|
151
151
|
|
152
152
|
context 'keyN' do
|
153
153
|
let(:config) {%[
|
154
154
|
mapping1 / http://foobar
|
155
|
-
key1 foo_count /${tags.first}/${tag_parts.last}/${tag_prefix[1]}/${foo_count}/${CGI.unescape(key)}
|
155
|
+
key1 foo_count /${tags.first}/${tag_parts.last}/${tag_prefix[1]}/${foo_count}/${CGI.unescape(key)}/${time}
|
156
156
|
enable_ruby true
|
157
157
|
]}
|
158
158
|
it { emit }
|
@@ -161,7 +161,7 @@ describe Fluent::YohoushiOutput do
|
|
161
161
|
context 'key_pattern' do
|
162
162
|
let(:config) {%[
|
163
163
|
mapping1 / http://foobar
|
164
|
-
key_pattern _count$ /${tags.first}/${tag_parts.last}/${tag_prefix[1]}/${foo_count}/${URI.unescape(key)}
|
164
|
+
key_pattern _count$ /${tags.first}/${tag_parts.last}/${tag_prefix[1]}/${foo_count}/${URI.unescape(key)}/${time.to_s}
|
165
165
|
enable_ruby true
|
166
166
|
]}
|
167
167
|
it { emit }
|
@@ -174,14 +174,14 @@ describe Fluent::YohoushiOutput do
|
|
174
174
|
let(:time) { Time.now.to_i }
|
175
175
|
let(:record) { { 'foo_count' => "1" } }
|
176
176
|
let(:emit) { driver.run { driver.emit(record, time) } }
|
177
|
-
let(:expected_path) {
|
177
|
+
let(:expected_path) { "/fluent/error/fluent.error/1/foo_count/#{Time.at(time)}" }
|
178
178
|
let(:expected_value) { '1' }
|
179
179
|
before { driver.instance.should_receive(:post).with(expected_path, expected_value) }
|
180
180
|
|
181
181
|
context 'keyN' do
|
182
182
|
let(:config) {%[
|
183
183
|
mapping1 / http://foobar
|
184
|
-
key1 foo_count /${tags[0]}/${tag_parts[-1]}/${tag_prefix[1]}/${foo_count}/${key}
|
184
|
+
key1 foo_count /${tags[0]}/${tag_parts[-1]}/${tag_prefix[1]}/${foo_count}/${key}/${time}
|
185
185
|
enable_ruby false
|
186
186
|
]}
|
187
187
|
it { emit }
|
@@ -190,7 +190,7 @@ describe Fluent::YohoushiOutput do
|
|
190
190
|
context 'key_pattern' do
|
191
191
|
let(:config) {%[
|
192
192
|
mapping1 / http://foobar
|
193
|
-
key_pattern _count$ /${tags[0]}/${tag_parts[-1]}/${tag_prefix[1]}/${foo_count}/${key}
|
193
|
+
key_pattern _count$ /${tags[0]}/${tag_parts[-1]}/${tag_prefix[1]}/${foo_count}/${key}/${time}
|
194
194
|
enable_ruby false
|
195
195
|
]}
|
196
196
|
it { emit }
|