fluentd 1.19.4 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/AGENTS.md +46 -0
  3. data/CHANGELOG.md +75 -0
  4. data/GithubWorkflow.md +1 -1
  5. data/MAINTAINERS.md +2 -2
  6. data/README.md +3 -2
  7. data/Rakefile +2 -1
  8. data/SECURITY.md +26 -1
  9. data/lib/fluent/command/cat.rb +2 -2
  10. data/lib/fluent/compat/exec_util.rb +20 -5
  11. data/lib/fluent/config/literal_parser.rb +4 -3
  12. data/lib/fluent/config/yaml_parser/loader.rb +12 -1
  13. data/lib/fluent/config/yaml_parser/parser.rb +14 -13
  14. data/lib/fluent/event.rb +37 -0
  15. data/lib/fluent/load.rb +0 -1
  16. data/lib/fluent/log.rb +2 -2
  17. data/lib/fluent/plugin/buf_file.rb +2 -2
  18. data/lib/fluent/plugin/buf_file_single.rb +6 -2
  19. data/lib/fluent/plugin/buffer/file_chunk.rb +23 -10
  20. data/lib/fluent/plugin/buffer/file_single_chunk.rb +23 -10
  21. data/lib/fluent/plugin/buffer.rb +102 -36
  22. data/lib/fluent/plugin/formatter_out_file.rb +3 -4
  23. data/lib/fluent/plugin/in_exec.rb +6 -4
  24. data/lib/fluent/plugin/in_forward.rb +39 -29
  25. data/lib/fluent/plugin/in_object_space.rb +2 -2
  26. data/lib/fluent/plugin/in_syslog.rb +2 -2
  27. data/lib/fluent/plugin/in_tail/compatibility.rb +111 -0
  28. data/lib/fluent/plugin/in_tail/dir_watcher.rb +713 -0
  29. data/lib/fluent/plugin/in_tail/group_watch.rb +13 -13
  30. data/lib/fluent/plugin/in_tail/io_handler.rb +391 -0
  31. data/lib/fluent/plugin/in_tail/line_feeder.rb +230 -0
  32. data/lib/fluent/plugin/in_tail/stat_watcher.rb +52 -0
  33. data/lib/fluent/plugin/in_tail/tail_watcher.rb +276 -0
  34. data/lib/fluent/plugin/in_tail/worker_pool.rb +298 -0
  35. data/lib/fluent/plugin/in_tail.rb +324 -815
  36. data/lib/fluent/plugin/in_unix.rb +5 -3
  37. data/lib/fluent/plugin/out_exec_filter.rb +2 -2
  38. data/lib/fluent/plugin/out_file.rb +10 -4
  39. data/lib/fluent/plugin/out_forward.rb +8 -0
  40. data/lib/fluent/plugin/out_http.rb +0 -10
  41. data/lib/fluent/plugin/output.rb +49 -19
  42. data/lib/fluent/plugin/parser_csv.rb +7 -2
  43. data/lib/fluent/plugin/parser_json.rb +20 -12
  44. data/lib/fluent/plugin/parser_ltsv.rb +2 -4
  45. data/lib/fluent/plugin/parser_msgpack.rb +7 -6
  46. data/lib/fluent/plugin/parser_syslog.rb +52 -5
  47. data/lib/fluent/plugin/parser_tsv.rb +6 -1
  48. data/lib/fluent/plugin_helper/http_server/server.rb +29 -13
  49. data/lib/fluent/plugin_helper/http_server.rb +2 -1
  50. data/lib/fluent/root_agent.rb +1 -1
  51. data/lib/fluent/supervisor.rb +24 -5
  52. data/lib/fluent/system_config.rb +5 -2
  53. data/lib/fluent/time.rb +8 -7
  54. data/lib/fluent/version.rb +1 -1
  55. data/templates/new_gem/.gitignore +8 -0
  56. metadata +39 -16
@@ -30,7 +30,7 @@ module Fluent
30
30
  :file_permission, :dir_permission, :counter_server, :counter_client,
31
31
  :strict_config_value, :enable_msgpack_time_support, :disable_shared_socket,
32
32
  :metrics, :enable_input_metrics, :enable_size_metrics, :enable_jit, :source_only_buffer,
33
- :config_include_dir
33
+ :config_include_dir, :umask
34
34
  ]
35
35
 
36
36
  config_param :workers, :integer, default: 1
@@ -53,7 +53,7 @@ module Fluent
53
53
  config_param :disable_shared_socket, :bool, default: nil
54
54
  config_param :enable_input_metrics, :bool, default: true
55
55
  config_param :enable_size_metrics, :bool, default: nil
56
- config_param :enable_jit, :bool, default: false
56
+ config_param :enable_jit, :bool, default: true
57
57
  config_param :file_permission, default: nil do |v|
58
58
  v.to_i(8)
59
59
  end
@@ -61,6 +61,9 @@ module Fluent
61
61
  v.to_i(8)
62
62
  end
63
63
  config_param :config_include_dir, default: Fluent::DEFAULT_CONFIG_INCLUDE_DIR
64
+ # Kept as a string (like the `--umask` command line option) so that it flows
65
+ # through the existing chumask handling, which applies `to_i(8)` later.
66
+ config_param :umask, :string, default: nil
64
67
  config_section :log, required: false, init: true, multi: false do
65
68
  config_param :path, :string, default: nil
66
69
  config_param :format, :enum, list: [:text, :json], default: :text
data/lib/fluent/time.rb CHANGED
@@ -112,9 +112,8 @@ module Fluent
112
112
  end
113
113
 
114
114
  def self.now
115
- # This method is called many time. so call Process.clock_gettime directly instead of Fluent::Clock.real_now
116
- now = Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond)
117
- Fluent::EventTime.new(now / 1_000_000_000, now % 1_000_000_000)
115
+ time = Time.now
116
+ Fluent::EventTime.new(time.to_i, time.nsec)
118
117
  end
119
118
 
120
119
  def self.parse(*args)
@@ -362,6 +361,8 @@ module Fluent
362
361
 
363
362
  class TimeFormatter
364
363
  def initialize(format = nil, localtime = true, timezone = nil)
364
+ # An empty cache slot is marked by a nil string, not by its key: 0 is a
365
+ # valid timestamp, so a key can never say whether the slot is filled.
365
366
  @tc1 = 0
366
367
  @tc1_str = nil
367
368
  @tc2 = 0
@@ -389,9 +390,9 @@ module Fluent
389
390
  end
390
391
 
391
392
  def format_without_subsec(time)
392
- if @tc1 == time
393
+ if @tc1_str && @tc1 == time
393
394
  return @tc1_str
394
- elsif @tc2 == time
395
+ elsif @tc2_str && @tc2 == time
395
396
  return @tc2_str
396
397
  else
397
398
  str = format_nocache(time)
@@ -407,9 +408,9 @@ module Fluent
407
408
  end
408
409
 
409
410
  def format_with_subsec(time)
410
- if Fluent::EventTime.eq?(@tc1, time)
411
+ if @tc1_str && Fluent::EventTime.eq?(@tc1, time)
411
412
  return @tc1_str
412
- elsif Fluent::EventTime.eq?(@tc2, time)
413
+ elsif @tc2_str && Fluent::EventTime.eq?(@tc2, time)
413
414
  return @tc2_str
414
415
  else
415
416
  str = format_nocache(time)
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Fluent
18
18
 
19
- VERSION = '1.19.4'
19
+ VERSION = '1.20.0'
20
20
 
21
21
  end
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluentd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.4
4
+ version: 1.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
@@ -43,20 +43,6 @@ dependencies:
43
43
  - - "<"
44
44
  - !ruby/object:Gem::Version
45
45
  version: 2.0.0
46
- - !ruby/object:Gem::Dependency
47
- name: yajl-ruby
48
- requirement: !ruby/object:Gem::Requirement
49
- requirements:
50
- - - "~>"
51
- - !ruby/object:Gem::Version
52
- version: '1.0'
53
- type: :runtime
54
- prerelease: false
55
- version_requirements: !ruby/object:Gem::Requirement
56
- requirements:
57
- - - "~>"
58
- - !ruby/object:Gem::Version
59
- version: '1.0'
60
46
  - !ruby/object:Gem::Dependency
61
47
  name: cool.io
62
48
  requirement: !ruby/object:Gem::Requirement
@@ -255,6 +241,34 @@ dependencies:
255
241
  - - "~>"
256
242
  - !ruby/object:Gem::Version
257
243
  version: '0.86'
244
+ - !ruby/object:Gem::Dependency
245
+ name: json
246
+ requirement: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - ">="
249
+ - !ruby/object:Gem::Version
250
+ version: '2.21'
251
+ type: :runtime
252
+ prerelease: false
253
+ version_requirements: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '2.21'
258
+ - !ruby/object:Gem::Dependency
259
+ name: yajl-ruby
260
+ requirement: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - "~>"
263
+ - !ruby/object:Gem::Version
264
+ version: '1.0'
265
+ type: :runtime
266
+ prerelease: false
267
+ version_requirements: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - "~>"
270
+ - !ruby/object:Gem::Version
271
+ version: '1.0'
258
272
  - !ruby/object:Gem::Dependency
259
273
  name: base64
260
274
  requirement: !ruby/object:Gem::Requirement
@@ -533,6 +547,7 @@ extra_rdoc_files: []
533
547
  files:
534
548
  - ".rubocop.yml"
535
549
  - ADOPTERS.md
550
+ - AGENTS.md
536
551
  - AUTHORS
537
552
  - CHANGELOG.md
538
553
  - CONTRIBUTING.md
@@ -718,8 +733,15 @@ files:
718
733
  - lib/fluent/plugin/in_sample.rb
719
734
  - lib/fluent/plugin/in_syslog.rb
720
735
  - lib/fluent/plugin/in_tail.rb
736
+ - lib/fluent/plugin/in_tail/compatibility.rb
737
+ - lib/fluent/plugin/in_tail/dir_watcher.rb
721
738
  - lib/fluent/plugin/in_tail/group_watch.rb
739
+ - lib/fluent/plugin/in_tail/io_handler.rb
740
+ - lib/fluent/plugin/in_tail/line_feeder.rb
722
741
  - lib/fluent/plugin/in_tail/position_file.rb
742
+ - lib/fluent/plugin/in_tail/stat_watcher.rb
743
+ - lib/fluent/plugin/in_tail/tail_watcher.rb
744
+ - lib/fluent/plugin/in_tail/worker_pool.rb
723
745
  - lib/fluent/plugin/in_tcp.rb
724
746
  - lib/fluent/plugin/in_udp.rb
725
747
  - lib/fluent/plugin/in_unix.rb
@@ -840,6 +862,7 @@ files:
840
862
  - lib/fluent/version.rb
841
863
  - lib/fluent/win32api.rb
842
864
  - lib/fluent/winsvc.rb
865
+ - templates/new_gem/.gitignore
843
866
  - templates/new_gem/Gemfile
844
867
  - templates/new_gem/README.md.erb
845
868
  - templates/new_gem/Rakefile
@@ -876,7 +899,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
876
899
  requirements:
877
900
  - - ">="
878
901
  - !ruby/object:Gem::Version
879
- version: '3.2'
902
+ version: '3.3'
880
903
  required_rubygems_version: !ruby/object:Gem::Requirement
881
904
  requirements:
882
905
  - - ">="