fluentd 1.11.3 → 1.11.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fluentd might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/fluent/plugin/out_http.rb +1 -1
- data/lib/fluent/plugin/output.rb +7 -5
- data/lib/fluent/plugin_helper/inject.rb +2 -1
- data/lib/fluent/version.rb +1 -1
- data/test/plugin/test_output.rb +12 -0
- data/test/plugin_helper/test_inject.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46c5740a224a7e5d8ecacf44bb857570817d1d45a71e62f20079a2017bab8494
|
4
|
+
data.tar.gz: f68bb5bfbdc31f86f70a6f1028ecfe824e4c90cd1de86392f21507d0ca15e636
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d62f1f3eed61c490d67c1eabd9ab18e3c8c15781524414b7b42f7b4594c25c015dd2daef69b2ed6505ee278d01bc7d2c6614036108ba616fbce2e53fd8ecb3a7
|
7
|
+
data.tar.gz: cb31f1cd2355020ad662afe508136eda92efd0846802a8097a97db24e792e5272817ba83338256480f879afd943226b1ca76030475e5081b87b29dd13e9acf34
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# v1.11
|
2
2
|
|
3
|
+
## Release v1.11.4 - 2020/10/13
|
4
|
+
|
5
|
+
### Enhancement
|
6
|
+
|
7
|
+
* inject: Support `unixtime_millis` in `time_type` parameter
|
8
|
+
https://github.com/fluent/fluentd/pull/3145
|
9
|
+
|
10
|
+
### Bug fix
|
11
|
+
|
12
|
+
* out_http: Fix broken data with `json_array true`
|
13
|
+
https://github.com/fluent/fluentd/pull/3144
|
14
|
+
* output: Fix wrong logging issue for `${chunk_id}`
|
15
|
+
https://github.com/fluent/fluentd/pull/3134
|
16
|
+
|
3
17
|
## Release v1.11.3 - 2020/09/30
|
4
18
|
|
5
19
|
### Enhancement
|
@@ -215,7 +215,7 @@ module Fluent::Plugin
|
|
215
215
|
req.basic_auth(@auth.username, @auth.password)
|
216
216
|
end
|
217
217
|
set_headers(req)
|
218
|
-
req.body = @json_array ? "[#{chunk.read.chop
|
218
|
+
req.body = @json_array ? "[#{chunk.read.chop}]" : chunk.read
|
219
219
|
req
|
220
220
|
end
|
221
221
|
|
data/lib/fluent/plugin/output.rb
CHANGED
@@ -769,17 +769,19 @@ module Fluent
|
|
769
769
|
end
|
770
770
|
end
|
771
771
|
|
772
|
-
|
773
|
-
log.warn "chunk key placeholder '#{$1}' not replaced. template:#{str}"
|
774
|
-
end
|
775
|
-
|
776
|
-
rvalue.sub(CHUNK_ID_PLACEHOLDER_PATTERN) {
|
772
|
+
rvalue = rvalue.sub(CHUNK_ID_PLACEHOLDER_PATTERN) {
|
777
773
|
if chunk_passed
|
778
774
|
dump_unique_id_hex(chunk.unique_id)
|
779
775
|
else
|
780
776
|
log.warn "${chunk_id} is not allowed in this plugin. Pass Chunk instead of metadata in extract_placeholders's 2nd argument"
|
781
777
|
end
|
782
778
|
}
|
779
|
+
|
780
|
+
if rvalue =~ CHUNK_KEY_PLACEHOLDER_PATTERN
|
781
|
+
log.warn "chunk key placeholder '#{$1}' not replaced. template:#{str}"
|
782
|
+
end
|
783
|
+
|
784
|
+
rvalue
|
783
785
|
end
|
784
786
|
end
|
785
787
|
|
@@ -76,7 +76,7 @@ module Fluent
|
|
76
76
|
config_param :time_key, :string, default: nil
|
77
77
|
|
78
78
|
# To avoid defining :time_type twice
|
79
|
-
config_param :time_type, :enum, list: [:float, :unixtime, :string], default: :float
|
79
|
+
config_param :time_type, :enum, list: [:float, :unixtime, :unixtime_millis, :string], default: :float
|
80
80
|
|
81
81
|
Fluent::TimeMixin::TIME_PARAMETERS.each do |name, type, opts|
|
82
82
|
config_param(name, type, **opts)
|
@@ -132,6 +132,7 @@ module Fluent
|
|
132
132
|
if @_inject_time_key
|
133
133
|
@_inject_time_formatter = case @inject_config.time_type
|
134
134
|
when :float then ->(time){ time.to_r.truncate(+6).to_f } # microsecond floating point value
|
135
|
+
when :unixtime_millis then ->(time) { time.to_f.floor(3) * 1000 }
|
135
136
|
when :unixtime then ->(time){ time.to_i }
|
136
137
|
else
|
137
138
|
localtime = @inject_config.localtime && !@inject_config.utc
|
data/lib/fluent/version.rb
CHANGED
data/test/plugin/test_output.rb
CHANGED
@@ -378,6 +378,18 @@ class OutputTest < Test::Unit::TestCase
|
|
378
378
|
assert { logs.any? { |log| log.include?("${chunk_id} is not allowed in this plugin") } }
|
379
379
|
end
|
380
380
|
|
381
|
+
test '#extract_placeholders does not log for ${chunk_id} placeholder' do
|
382
|
+
@i.configure(config_element('ROOT', '', {}, [config_element('buffer', '')]))
|
383
|
+
tmpl = "/mypath/${chunk_id}/tail"
|
384
|
+
t = event_time('2016-04-11 20:30:00 +0900')
|
385
|
+
v = {key1: "value1", key2: "value2"}
|
386
|
+
c = create_chunk(timekey: t, tag: 'fluentd.test.output', variables: v)
|
387
|
+
@i.log.out.logs.clear
|
388
|
+
@i.extract_placeholders(tmpl, c)
|
389
|
+
logs = @i.log.out.logs
|
390
|
+
assert { logs.none? { |log| log.include?("${chunk_id}") } }
|
391
|
+
end
|
392
|
+
|
381
393
|
test '#extract_placeholders logs warn message with not replaced key' do
|
382
394
|
@i.configure(config_element('ROOT', '', {}, [config_element('buffer', '')]))
|
383
395
|
tmpl = "/mypath/${key1}/test"
|
@@ -176,6 +176,19 @@ class InjectHelperTest < Test::Unit::TestCase
|
|
176
176
|
assert_equal record.merge({"timedata" => float_time}), @d.inject_values_to_record('tag', time, record)
|
177
177
|
end
|
178
178
|
|
179
|
+
test 'injects time as unix time millis into specified key' do
|
180
|
+
time_in_unix = Time.parse("2016-06-21 08:10:11 +0900").to_i
|
181
|
+
time_subsecond = 320_101_224
|
182
|
+
time = Fluent::EventTime.new(time_in_unix, time_subsecond)
|
183
|
+
unixtime_millis = 1466464211320
|
184
|
+
|
185
|
+
@d.configure(config_inject_section("time_key" => "timedata", "time_type" => "unixtime_millis"))
|
186
|
+
@d.start
|
187
|
+
|
188
|
+
record = {"key1" => "value1", "key2" => 2}
|
189
|
+
assert_equal record.merge({"timedata" => unixtime_millis}), @d.inject_values_to_record('tag', time, record)
|
190
|
+
end
|
191
|
+
|
179
192
|
test 'injects time as unix time into specified key' do
|
180
193
|
time_in_unix = Time.parse("2016-06-21 08:10:11 +0900").to_i
|
181
194
|
time_subsecond = 320_101_224
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluentd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|