fluentd 1.10.3 → 1.11.3

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.

Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +102 -0
  3. data/CONTRIBUTING.md +1 -1
  4. data/example/copy_roundrobin.conf +3 -3
  5. data/example/counter.conf +1 -1
  6. data/example/filter_stdout.conf +2 -2
  7. data/example/{in_dummy_blocks.conf → in_sample_blocks.conf} +4 -4
  8. data/example/{in_dummy_with_compression.conf → in_sample_with_compression.conf} +3 -3
  9. data/example/logevents.conf +5 -5
  10. data/example/multi_filters.conf +1 -1
  11. data/example/out_exec_filter.conf +2 -2
  12. data/example/out_forward.conf +1 -1
  13. data/example/out_forward_buf_file.conf +1 -1
  14. data/example/out_forward_client.conf +5 -5
  15. data/example/out_forward_heartbeat_none.conf +1 -1
  16. data/example/out_forward_sd.conf +1 -1
  17. data/example/out_forward_shared_key.conf +2 -2
  18. data/example/out_forward_tls.conf +1 -1
  19. data/example/out_forward_users.conf +3 -3
  20. data/example/out_null.conf +4 -4
  21. data/example/secondary_file.conf +1 -1
  22. data/fluentd.gemspec +5 -5
  23. data/lib/fluent/command/fluentd.rb +11 -0
  24. data/lib/fluent/log.rb +33 -3
  25. data/lib/fluent/match.rb +9 -0
  26. data/lib/fluent/plugin/buffer.rb +49 -40
  27. data/lib/fluent/plugin/buffer/chunk.rb +2 -1
  28. data/lib/fluent/plugin/in_dummy.rb +2 -123
  29. data/lib/fluent/plugin/in_exec.rb +4 -2
  30. data/lib/fluent/plugin/in_forward.rb +2 -2
  31. data/lib/fluent/plugin/in_gc_stat.rb +16 -0
  32. data/lib/fluent/plugin/in_http.rb +148 -77
  33. data/lib/fluent/plugin/in_monitor_agent.rb +1 -1
  34. data/lib/fluent/plugin/in_sample.rb +141 -0
  35. data/lib/fluent/plugin/in_tail.rb +2 -2
  36. data/lib/fluent/plugin/in_unix.rb +77 -77
  37. data/lib/fluent/plugin/out_file.rb +1 -1
  38. data/lib/fluent/plugin/out_forward.rb +1 -1
  39. data/lib/fluent/plugin/out_forward/load_balancer.rb +1 -1
  40. data/lib/fluent/plugin/out_http.rb +15 -2
  41. data/lib/fluent/plugin/output.rb +1 -0
  42. data/lib/fluent/plugin/parser_json.rb +5 -2
  43. data/lib/fluent/plugin/parser_syslog.rb +215 -54
  44. data/lib/fluent/plugin_helper/cert_option.rb +5 -8
  45. data/lib/fluent/plugin_helper/child_process.rb +3 -2
  46. data/lib/fluent/plugin_helper/socket.rb +1 -1
  47. data/lib/fluent/supervisor.rb +15 -6
  48. data/lib/fluent/system_config.rb +2 -1
  49. data/lib/fluent/test/filter_test.rb +2 -2
  50. data/lib/fluent/test/output_test.rb +3 -3
  51. data/lib/fluent/version.rb +1 -1
  52. data/test/plugin/out_forward/test_load_balancer.rb +46 -0
  53. data/test/plugin/test_buffer.rb +4 -0
  54. data/test/plugin/test_in_exec.rb +18 -0
  55. data/test/plugin/test_in_gc_stat.rb +24 -1
  56. data/test/plugin/test_in_http.rb +57 -0
  57. data/test/plugin/{test_in_dummy.rb → test_in_sample.rb} +25 -25
  58. data/test/plugin/test_in_tail.rb +3 -0
  59. data/test/plugin/test_in_unix.rb +128 -73
  60. data/test/plugin/test_out_http.rb +38 -0
  61. data/test/plugin/test_parser_syslog.rb +66 -29
  62. data/test/plugin_helper/data/cert/empty.pem +0 -0
  63. data/test/plugin_helper/test_cert_option.rb +7 -0
  64. data/test/plugin_helper/test_child_process.rb +15 -0
  65. data/test/plugin_helper/test_http_server_helper.rb +5 -0
  66. data/test/plugin_helper/test_server.rb +34 -0
  67. data/test/plugin_helper/test_socket.rb +8 -0
  68. data/test/test_log.rb +44 -0
  69. data/test/test_match.rb +11 -0
  70. data/test/test_static_config_analysis.rb +2 -2
  71. metadata +9 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a83d0f39bb55eb7343c7a19e126bd98ebf9ab907439ce95ef39546993eb9188
4
- data.tar.gz: dac26a7c7a3db09b59ae5b96cf1e76f7dd7aa975a3e08474aa636f1950dfa4e8
3
+ metadata.gz: 9fac73611b9d1c9b470912f6de8294795e5e8809d1730fa9f692aae4777ffdc2
4
+ data.tar.gz: 88c9fe2ccf19fa1a1e82924072182ed7c0c688e70f25dcdff8245d386644faee
5
5
  SHA512:
6
- metadata.gz: b39ee59f0649ce9f0558d335b8a0acbdfc371601bb1af9978cc97eb955fe4e3dfdb6ac7839583a146116479a61ff7d2afd3ce4eeccad5327273ea930aa9a73ff
7
- data.tar.gz: ca26fc34d1327d39e97cbbaa3c782720971ae56273f9393656abbcc601584117b11d35c8db2d60e548ab6292e309cb27a056c3ad76fc644579f6ac5d4c2f46f0
6
+ metadata.gz: d8ee0bff2c2fb43bd8cbcf727de8cf31ab885ecd4e4eae299c2588559d665a4c309a8b575cedadd6534a51962934d6f643eda5baa6056759345814fb1ab084ee
7
+ data.tar.gz: 40c86faa9b747e65e32ffa004f5f1e8b5563fb81f5d686174da99866ad0c8789d91d465e78d5e4fff891359b05a71db4e204f2f91eed737c6cc5804999644ab7
@@ -1,5 +1,107 @@
1
+ # v1.11
2
+
3
+ ## Release v1.11.3 - 2020/09/30
4
+
5
+ ### Enhancement
6
+
7
+ * in_exec: Add `connect_mode` parameter to read stderr
8
+ https://github.com/fluent/fluentd/pull/3108
9
+ * parser_json: Improve the performance
10
+ https://github.com/fluent/fluentd/pull/3109
11
+ * log: Add `ignore_same_log_interval` parameter
12
+ https://github.com/fluent/fluentd/pull/3119
13
+ * Upgrade win32 gems
14
+ https://github.com/fluent/fluentd/pull/3100
15
+ * Refactoring code
16
+ https://github.com/fluent/fluentd/pull/3094
17
+ https://github.com/fluent/fluentd/pull/3118
18
+
19
+ ### Bug fix
20
+
21
+ * buffer: Fix calculation of timekey stats
22
+ https://github.com/fluent/fluentd/pull/3018
23
+ * buffer: fix binmode usage for prevent gc
24
+ https://github.com/fluent/fluentd/pull/3138
25
+
26
+ ## Release v1.11.2 - 2020/08/04
27
+
28
+ ### Enhancement
29
+
30
+ * `in_dummy` renamed to `in_sample`
31
+ https://github.com/fluent/fluentd/pull/3065
32
+ * Allow regular expression in filter/match directive
33
+ https://github.com/fluent/fluentd/pull/3071
34
+ * Refactoring code
35
+ https://github.com/fluent/fluentd/pull/3051
36
+
37
+ ### Bug fix
38
+
39
+ * buffer: Fix log message for `chunk_limit_records` case
40
+ https://github.com/fluent/fluentd/pull/3079
41
+ * buffer: Fix timekey optimization for non-windows platform
42
+ https://github.com/fluent/fluentd/pull/3092
43
+ * cert: Raise an error for broken certificate file
44
+ https://github.com/fluent/fluentd/pull/3086
45
+ * cert: Set TLS ciphers list correcty on older OpenSSL
46
+ https://github.com/fluent/fluentd/pull/3093
47
+
48
+ ## Release v1.11.1 - 2020/06/22
49
+
50
+ ### Enhancement
51
+
52
+ * in_http: Add `dump_error_log` parameter
53
+ https://github.com/fluent/fluentd/pull/3035
54
+ * in_http: Improve time field handling
55
+ https://github.com/fluent/fluentd/pull/3046
56
+ * Refactoring code
57
+ https://github.com/fluent/fluentd/pull/3047
58
+
59
+ ### Bug fix
60
+
61
+ * in_tail: Use actual path instead of based pattern for ignore list
62
+ https://github.com/fluent/fluentd/pull/3042
63
+ * child_process helper: Fix child process failure due to SIGPIPE if the command uses stdout
64
+ https://github.com/fluent/fluentd/pull/3044
65
+
66
+ ## Release v1.11.0 - 2020/06/04
67
+
68
+ ### New feature
69
+
70
+ * in_unix: Use v1 API
71
+ https://github.com/fluent/fluentd/pull/2992
72
+
73
+ ### Enhancement
74
+
75
+ * parser_syslog: Support any `time_format` for RFC3164 string parser
76
+ https://github.com/fluent/fluentd/pull/3014
77
+ * parser_syslog: Add new parser for RFC5424
78
+ https://github.com/fluent/fluentd/pull/3015
79
+ * Refactoring code
80
+ https://github.com/fluent/fluentd/pull/3019
81
+
82
+ ### Bug fix
83
+
84
+ * in_gc_stat: Add `use_symbol_keys` parameter to emit string key record
85
+ https://github.com/fluent/fluentd/pull/3008
86
+
1
87
  # v1.10
2
88
 
89
+ ## Release v1.10.4 - 2020/05/12
90
+
91
+ ### Enhancement
92
+
93
+ * out_http: Support single json array payload
94
+ https://github.com/fluent/fluentd/pull/2973
95
+ * Refactoring
96
+ https://github.com/fluent/fluentd/pull/2988
97
+
98
+ ### Bug fix
99
+
100
+ * supervisor: Call `File.umask(0)` for standalone worker
101
+ https://github.com/fluent/fluentd/pull/2987
102
+ * out_forward: Fix ZeroDivisionError issue with `weight 0`
103
+ https://github.com/fluent/fluentd/pull/2989
104
+
3
105
  ## Release v1.10.3 - 2020/05/01
4
106
 
5
107
  ### Enhancement
@@ -24,7 +24,7 @@ If you find a bug of Fluentd or a mistake in the documentation, you can help us
24
24
  submitting an issue to Fluentd. Even better you can submit a Pull Request with a fix.
25
25
 
26
26
  * **Fluentd**: Use [fluentd](https://github.com/fluent/fluentd) repository. Fill issue template.
27
- * **Documentation**: Use [fluentd-docs](https://github.com/fluent/fluentd-docs-gitbook) repository.
27
+ * **Documentation**: Use [fluentd documentation](https://github.com/fluent/fluentd-docs-gitbook) repository.
28
28
 
29
29
  If you find a bug of 3rd party plugins, please submit an issue to each plugin repository.
30
30
  And use [omnibus-td-agent](https://github.com/treasure-data/omnibus-td-agent) repository for td-agent related issues.
@@ -1,12 +1,12 @@
1
1
  <source>
2
- @type dummy
2
+ @type sample
3
3
  @label @test
4
4
  tag test.copy
5
5
  auto_increment_key id
6
6
  </source>
7
7
 
8
8
  <source>
9
- @type dummy
9
+ @type sample
10
10
  @label @test
11
11
  tag test.rr
12
12
  auto_increment_key id
@@ -36,4 +36,4 @@
36
36
  output_type ltsv
37
37
  </store>
38
38
  </match>
39
- </label>
39
+ </label>
@@ -8,7 +8,7 @@
8
8
  </system>
9
9
 
10
10
  <source>
11
- @type dummy
11
+ @type sample
12
12
  tag "test.data"
13
13
  auto_increment_key number
14
14
  </source>
@@ -1,6 +1,6 @@
1
1
  <source>
2
- @type dummy
3
- tag dummy
2
+ @type sample
3
+ tag sample
4
4
  </source>
5
5
 
6
6
  <filter **>
@@ -1,11 +1,11 @@
1
1
  <source>
2
- @type dummy
3
- tag dummy
2
+ @type sample
3
+ tag sample
4
4
  rate 100
5
- dummy {"message":"yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay"}
5
+ sample {"message":"yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay"}
6
6
  </source>
7
7
 
8
- <match dummy>
8
+ <match sample>
9
9
  @type null
10
10
  never_flush true
11
11
  <buffer>
@@ -1,16 +1,16 @@
1
1
  <source>
2
- @type dummy
2
+ @type sample
3
3
  @label @main
4
4
  tag "test.data"
5
5
  size 2
6
6
  rate 10
7
- dummy {"message":"yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay"}
7
+ sample {"message":"yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay"}
8
8
  auto_increment_key number
9
9
  </source>
10
10
 
11
11
  <label @main>
12
12
  <match test.data>
13
- @type buffered_stdout
13
+ @type stdout
14
14
  <buffer>
15
15
  @type file
16
16
  path "#{Dir.pwd}/compressed_buffers"
@@ -1,10 +1,10 @@
1
1
  <source>
2
- @type dummy
3
- @label @dummylog
2
+ @type sample
3
+ @label @samplelog
4
4
  tag "data"
5
- dummy {"message":"yay"}
5
+ sample {"message":"yay"}
6
6
  </source>
7
- <label @dummylog>
7
+ <label @samplelog>
8
8
  <match **>
9
9
  @type stdout
10
10
  </match>
@@ -22,4 +22,4 @@
22
22
  # hostname_key "host"
23
23
  # </inject>
24
24
  # </match>
25
- </label>
25
+ </label>
@@ -1,7 +1,7 @@
1
1
  # This example is to measure optimized filter pipeline performance.
2
2
 
3
3
  <source>
4
- @type dummy
4
+ @type sample
5
5
  tag test
6
6
  size 1000
7
7
  </source>
@@ -1,10 +1,10 @@
1
1
  <source>
2
- @type dummy
2
+ @type sample
3
3
  @label @exec
4
4
  tag exec_input
5
5
  rate 10
6
6
  auto_increment_key num
7
- dummy {"data":"mydata"}
7
+ sample {"data":"mydata"}
8
8
  </source>
9
9
 
10
10
  <label @exec>
@@ -1,5 +1,5 @@
1
1
  <source>
2
- @type dummy
2
+ @type sample
3
3
  tag test
4
4
  </source>
5
5
 
@@ -1,5 +1,5 @@
1
1
  <source>
2
- @type dummy
2
+ @type sample
3
3
  tag test
4
4
  </source>
5
5
 
@@ -1,21 +1,21 @@
1
1
  <source>
2
- @type dummy
2
+ @type sample
3
3
  tag test
4
4
  </source>
5
5
  <source>
6
- @type dummy
6
+ @type sample
7
7
  tag test2
8
8
  </source>
9
9
  <source>
10
- @type dummy
10
+ @type sample
11
11
  tag test3
12
12
  </source>
13
13
  <source>
14
- @type dummy
14
+ @type sample
15
15
  tag test4
16
16
  </source>
17
17
  <source>
18
- @type dummy
18
+ @type sample
19
19
  tag test5
20
20
  </source>
21
21
 
@@ -1,5 +1,5 @@
1
1
  <source>
2
- @type dummy
2
+ @type sample
3
3
  tag test
4
4
  </source>
5
5
 
@@ -1,5 +1,5 @@
1
1
  <source>
2
- @type dummy
2
+ @type sample
3
3
  tag test
4
4
  </source>
5
5
 
@@ -1,9 +1,9 @@
1
1
  <source>
2
- @type dummy
2
+ @type sample
3
3
  tag test
4
4
  </source>
5
5
  <source>
6
- @type dummy
6
+ @type sample
7
7
  tag test2
8
8
  </source>
9
9
 
@@ -1,5 +1,5 @@
1
1
  <source>
2
- @type dummy
2
+ @type sample
3
3
  tag test
4
4
  </source>
5
5
 
@@ -1,13 +1,13 @@
1
1
  <source>
2
- @type dummy
2
+ @type sample
3
3
  tag test
4
4
  </source>
5
5
  <source>
6
- @type dummy
6
+ @type sample
7
7
  tag test2
8
8
  </source>
9
9
  <source>
10
- @type dummy
10
+ @type sample
11
11
  tag test3
12
12
  </source>
13
13
 
@@ -2,17 +2,17 @@
2
2
  # bundle exec bin/fluentd -c example/out_buffered_null.conf
3
3
  # (+ --emit-error-log-interval 10)
4
4
  <source>
5
- @type dummy
6
- tag dummy
5
+ @type sample
6
+ tag sample
7
7
  rate 500000000
8
- dummy [
8
+ sample [
9
9
  {"message": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},
10
10
  {"message": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"},
11
11
  {"message": "ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"}
12
12
  ]
13
13
  </source>
14
14
 
15
- <match dummy.**>
15
+ <match sample.**>
16
16
  @type null
17
17
  <buffer>
18
18
  flush_interval 60s
@@ -3,7 +3,7 @@
3
3
  </system>
4
4
 
5
5
  <source>
6
- @type dummy
6
+ @type sample
7
7
  tag test
8
8
  </source>
9
9
 
@@ -32,11 +32,11 @@ Gem::Specification.new do |gem|
32
32
  fake_platform = ENV['GEM_BUILD_FAKE_PLATFORM'].to_s
33
33
  gem.platform = fake_platform unless fake_platform.empty?
34
34
  if /mswin|mingw/ =~ fake_platform || (/mswin|mingw/ =~ RUBY_PLATFORM && fake_platform.empty?)
35
- gem.add_runtime_dependency("win32-service", ["~> 0.8.3"])
36
- gem.add_runtime_dependency("win32-ipc", ["~> 0.6.1"])
37
- gem.add_runtime_dependency("win32-event", ["~> 0.6.1"])
38
- gem.add_runtime_dependency("windows-pr", ["~> 1.2.5"])
39
- gem.add_runtime_dependency("certstore_c", ["~> 0.1.2"])
35
+ gem.add_runtime_dependency("win32-service", ["~> 2.1.5"])
36
+ gem.add_runtime_dependency("win32-ipc", ["~> 0.7.0"])
37
+ gem.add_runtime_dependency("win32-event", ["~> 0.6.3"])
38
+ gem.add_runtime_dependency("windows-pr", ["~> 1.2.6"])
39
+ gem.add_runtime_dependency("certstore_c", ["~> 0.1.7"])
40
40
  end
41
41
 
42
42
  gem.add_development_dependency("rake", ["~> 13.0"])
@@ -185,6 +185,10 @@ if Fluent.windows?
185
185
  opts[:regwinsvcautostart] = s
186
186
  }
187
187
 
188
+ op.on('--[no-]reg-winsvc-delay-start', "Automatically start the Windows Service at boot with delay. (only effective with '--reg-winsvc i' and '--reg-winsvc-auto-start') (Windows only)") {|s|
189
+ opts[:regwinsvcdelaystart] = s
190
+ }
191
+
188
192
  op.on('--reg-winsvc-fluentdopt OPTION', "specify fluentd option parameters for Windows Service. (Windows only)") {|s|
189
193
  opts[:fluentdopt] = s
190
194
  }
@@ -285,6 +289,13 @@ if winsvcinstmode = opts[:regwinsvc]
285
289
  dependencies: [""],
286
290
  display_name: opts[:winsvc_display_name]
287
291
  )
292
+
293
+ if opts[:regwinsvcdelaystart]
294
+ Service.configure(
295
+ service_name: opts[:winsvc_name],
296
+ delayed_start: true
297
+ )
298
+ end
288
299
  when 'u'
289
300
  if Service.status(opts[:winsvc_name]).current_state != 'stopped'
290
301
  begin
@@ -113,6 +113,7 @@ module Fluent
113
113
 
114
114
  @suppress_repeated_stacktrace = opts[:suppress_repeated_stacktrace]
115
115
  @ignore_repeated_log_interval = opts[:ignore_repeated_log_interval]
116
+ @ignore_same_log_interval = opts[:ignore_same_log_interval]
116
117
 
117
118
  @process_type = opts[:process_type] # :supervisor, :worker0, :workers Or :standalone
118
119
  @process_type ||= :standalone # to keep behavior of existing code
@@ -141,7 +142,8 @@ module Fluent
141
142
  dl_opts[:log_level] = @level - 1
142
143
  logger = ServerEngine::DaemonLogger.new(@out, dl_opts)
143
144
  clone = self.class.new(logger, suppress_repeated_stacktrace: @suppress_repeated_stacktrace, process_type: @process_type,
144
- worker_id: @worker_id, ignore_repeated_log_interval: @ignore_repeated_log_interval)
145
+ worker_id: @worker_id, ignore_repeated_log_interval: @ignore_repeated_log_interval,
146
+ ignore_same_log_interval: @ignore_same_log_interval)
145
147
  clone.format = @format
146
148
  clone.time_format = @time_format
147
149
  clone.log_event_enabled = @log_event_enabled
@@ -151,7 +153,7 @@ module Fluent
151
153
 
152
154
  attr_reader :format
153
155
  attr_reader :time_format
154
- attr_accessor :log_event_enabled, :ignore_repeated_log_interval
156
+ attr_accessor :log_event_enabled, :ignore_repeated_log_interval, :ignore_same_log_interval
155
157
  attr_accessor :out
156
158
  attr_accessor :level
157
159
  attr_accessor :optional_header, :optional_attrs
@@ -428,6 +430,27 @@ module Fluent
428
430
  (cached_log.msg == message) && (time - cached_log.time <= @ignore_repeated_log_interval)
429
431
  end
430
432
 
433
+ def ignore_same_log?(time, message)
434
+ cached_log = Thread.current[:last_same_log]
435
+ if cached_log.nil?
436
+ Thread.current[:last_same_log] = {message => time}
437
+ return false
438
+ end
439
+
440
+ prev_time = cached_log[message]
441
+ if prev_time
442
+ if (time - prev_time) <= @ignore_same_log_interval
443
+ true
444
+ else
445
+ cached_log[message] = time
446
+ false
447
+ end
448
+ else
449
+ cached_log[message] = time
450
+ false
451
+ end
452
+ end
453
+
431
454
  def suppress_stacktrace?(backtrace)
432
455
  cached_log = Thread.current[:last_repeated_stacktrace]
433
456
  return false if cached_log.nil?
@@ -507,7 +530,11 @@ module Fluent
507
530
  end
508
531
  }
509
532
 
510
- if @ignore_repeated_log_interval
533
+ if @ignore_same_log_interval
534
+ if ignore_same_log?(time, message)
535
+ return nil, nil
536
+ end
537
+ elsif @ignore_repeated_log_interval
511
538
  if ignore_repeated_log?(:last_repeated_log, time, message)
512
539
  return nil, nil
513
540
  else
@@ -569,6 +596,9 @@ module Fluent
569
596
  if logger.instance_variable_defined?(:@ignore_repeated_log_interval)
570
597
  @ignore_repeated_log_interval = logger.instance_variable_get(:@ignore_repeated_log_interval)
571
598
  end
599
+ if logger.instance_variable_defined?(:@ignore_same_log_interval)
600
+ @ignore_same_log_interval = logger.instance_variable_get(:@ignore_same_log_interval)
601
+ end
572
602
 
573
603
  self.format = @logger.format
574
604
  self.time_format = @logger.time_format