fluentd 1.11.3-x64-mingw32 → 1.11.4-x64-mingw32

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '049804cc2406faca810a3b4df1e9169b07af160b859e631d75ea87f346a6d97e'
4
- data.tar.gz: f6ed05570e467b952809866d6aaa983cb60a6324afaf5bc7b05d9a8c47c7f930
3
+ metadata.gz: 199643a709aff608a2717466013d7a9c462f070fc817f1a802d3e623e28a6cc1
4
+ data.tar.gz: eaf551474e4ddfd6f0693ad1fd82ca7877a4b2060521b3943d4d97beb6f5c5a7
5
5
  SHA512:
6
- metadata.gz: 95a59c7d57b2ca5d1973357902ebbeccba5ebfa9670bb0dcd5038ae29497e92b056cf57d416ea65eb72509638b4712c679e767cc6ae3ff041cdee4fed0848dc1
7
- data.tar.gz: 1e7191b57fe275bfb379af2d6787945158dca6f4334a568e8ff5a4a01fb1e4c2a372382bfbc3e13abf76b05323ce78a66eb387328d315f7d841ae9bd677dc776
6
+ metadata.gz: c82dd4eae7bb3a2ddb519d08a69f0bd8687453ebe8078339dd6de3fd4f2fb0bfe8276fe0c8f1b1b0f7c5c49d626bf81e3a23f51fd48d1ed1064b1bbbb0a812af
7
+ data.tar.gz: ca2039bfcebf63cb88392180870879af253222ec3c5a7f8d5d324737a167acf4bf07f95b149dd60e9877bcf194afebf02896b84b52d6d282c3831b97a79e91d1
@@ -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!}]" : chunk.read
218
+ req.body = @json_array ? "[#{chunk.read.chop}]" : chunk.read
219
219
  req
220
220
  end
221
221
 
@@ -769,17 +769,19 @@ module Fluent
769
769
  end
770
770
  end
771
771
 
772
- if rvalue =~ CHUNK_KEY_PLACEHOLDER_PATTERN
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
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Fluent
18
18
 
19
- VERSION = '1.11.3'
19
+ VERSION = '1.11.4'
20
20
 
21
21
  end
@@ -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.3
4
+ version: 1.11.4
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-30 00:00:00.000000000 Z
11
+ date: 2020-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack