fluentd 1.3.3 → 1.15.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (382) hide show
  1. checksums.yaml +5 -5
  2. data/.deepsource.toml +13 -0
  3. data/.drone.yml +35 -0
  4. data/.github/ISSUE_TEMPLATE/bug_report.yaml +70 -0
  5. data/.github/ISSUE_TEMPLATE/config.yml +5 -0
  6. data/.github/ISSUE_TEMPLATE/feature_request.yaml +38 -0
  7. data/.github/ISSUE_TEMPLATE.md +15 -4
  8. data/.github/PULL_REQUEST_TEMPLATE.md +14 -0
  9. data/.github/workflows/linux-test.yaml +36 -0
  10. data/.github/workflows/macos-test.yaml +34 -0
  11. data/.github/workflows/windows-test.yaml +49 -0
  12. data/.gitignore +3 -1
  13. data/.gitlab-ci.yml +103 -0
  14. data/CHANGELOG.md +1383 -7
  15. data/CONTRIBUTING.md +5 -5
  16. data/GithubWorkflow.md +78 -0
  17. data/MAINTAINERS.md +7 -3
  18. data/README.md +22 -29
  19. data/Rakefile +7 -2
  20. data/SECURITY.md +18 -0
  21. data/bin/fluent-cap-ctl +7 -0
  22. data/bin/fluent-ctl +7 -0
  23. data/bin/fluentd +8 -1
  24. data/docs/SECURITY_AUDIT.pdf +0 -0
  25. data/example/copy_roundrobin.conf +3 -3
  26. data/example/counter.conf +2 -2
  27. data/example/filter_stdout.conf +2 -2
  28. data/example/in_http.conf +3 -1
  29. data/example/{in_dummy_blocks.conf → in_sample_blocks.conf} +4 -4
  30. data/example/{in_dummy_with_compression.conf → in_sample_with_compression.conf} +3 -3
  31. data/example/logevents.conf +5 -5
  32. data/example/multi_filters.conf +1 -1
  33. data/example/out_exec_filter.conf +2 -2
  34. data/example/out_forward.conf +1 -1
  35. data/example/out_forward_buf_file.conf +1 -1
  36. data/example/out_forward_client.conf +5 -5
  37. data/example/out_forward_heartbeat_none.conf +1 -1
  38. data/example/out_forward_sd.conf +17 -0
  39. data/example/out_forward_shared_key.conf +2 -2
  40. data/example/out_forward_tls.conf +1 -1
  41. data/example/out_forward_users.conf +3 -3
  42. data/example/out_null.conf +4 -4
  43. data/example/sd.yaml +8 -0
  44. data/example/secondary_file.conf +1 -1
  45. data/example/v0_12_filter.conf +2 -2
  46. data/fluentd.gemspec +18 -15
  47. data/lib/fluent/agent.rb +3 -1
  48. data/lib/fluent/capability.rb +87 -0
  49. data/lib/fluent/clock.rb +4 -0
  50. data/lib/fluent/command/bundler_injection.rb +1 -1
  51. data/lib/fluent/command/ca_generate.rb +7 -4
  52. data/lib/fluent/command/cap_ctl.rb +174 -0
  53. data/lib/fluent/command/cat.rb +34 -12
  54. data/lib/fluent/command/ctl.rb +180 -0
  55. data/lib/fluent/command/debug.rb +1 -0
  56. data/lib/fluent/command/fluentd.rb +73 -18
  57. data/lib/fluent/command/plugin_config_formatter.rb +36 -7
  58. data/lib/fluent/command/plugin_generator.rb +50 -4
  59. data/lib/fluent/compat/call_super_mixin.rb +9 -0
  60. data/lib/fluent/compat/exec_util.rb +1 -1
  61. data/lib/fluent/compat/output.rb +9 -6
  62. data/lib/fluent/compat/parser.rb +2 -2
  63. data/lib/fluent/compat/socket_util.rb +2 -2
  64. data/lib/fluent/config/configure_proxy.rb +4 -4
  65. data/lib/fluent/config/element.rb +44 -24
  66. data/lib/fluent/config/error.rb +18 -0
  67. data/lib/fluent/config/literal_parser.rb +40 -13
  68. data/lib/fluent/config/parser.rb +1 -1
  69. data/lib/fluent/config/section.rb +57 -8
  70. data/lib/fluent/config/types.rb +115 -28
  71. data/lib/fluent/config/v1_parser.rb +10 -7
  72. data/lib/fluent/config/yaml_parser/fluent_value.rb +47 -0
  73. data/lib/fluent/config/yaml_parser/loader.rb +108 -0
  74. data/lib/fluent/config/yaml_parser/parser.rb +166 -0
  75. data/lib/fluent/config/yaml_parser/section_builder.rb +107 -0
  76. data/lib/fluent/config/yaml_parser.rb +56 -0
  77. data/lib/fluent/config.rb +33 -0
  78. data/lib/fluent/configurable.rb +2 -2
  79. data/lib/fluent/counter/base_socket.rb +2 -4
  80. data/lib/fluent/counter/client.rb +1 -1
  81. data/lib/fluent/daemonizer.rb +88 -0
  82. data/lib/fluent/engine.rb +97 -127
  83. data/lib/fluent/env.rb +12 -1
  84. data/lib/fluent/error.rb +7 -0
  85. data/lib/fluent/event.rb +30 -38
  86. data/lib/fluent/event_router.rb +49 -3
  87. data/lib/fluent/ext_monitor_require.rb +28 -0
  88. data/lib/fluent/file_wrapper.rb +137 -0
  89. data/lib/fluent/fluent_log_event_router.rb +141 -0
  90. data/lib/fluent/load.rb +1 -2
  91. data/lib/fluent/log.rb +88 -11
  92. data/lib/fluent/match.rb +10 -1
  93. data/lib/fluent/msgpack_factory.rb +50 -6
  94. data/lib/fluent/oj_options.rb +61 -0
  95. data/lib/fluent/plugin/bare_output.rb +50 -9
  96. data/lib/fluent/plugin/base.rb +34 -4
  97. data/lib/fluent/plugin/buf_file.rb +53 -24
  98. data/lib/fluent/plugin/buf_file_single.rb +225 -0
  99. data/lib/fluent/plugin/buffer/chunk.rb +24 -5
  100. data/lib/fluent/plugin/buffer/file_chunk.rb +48 -18
  101. data/lib/fluent/plugin/buffer/file_single_chunk.rb +311 -0
  102. data/lib/fluent/plugin/buffer/memory_chunk.rb +2 -1
  103. data/lib/fluent/plugin/buffer.rb +288 -85
  104. data/lib/fluent/plugin/compressable.rb +11 -7
  105. data/lib/fluent/plugin/filter.rb +35 -1
  106. data/lib/fluent/plugin/filter_grep.rb +2 -2
  107. data/lib/fluent/plugin/filter_parser.rb +1 -1
  108. data/lib/fluent/plugin/formatter.rb +25 -0
  109. data/lib/fluent/plugin/formatter_csv.rb +33 -7
  110. data/lib/fluent/plugin/formatter_hash.rb +3 -1
  111. data/lib/fluent/plugin/formatter_json.rb +12 -8
  112. data/lib/fluent/plugin/formatter_ltsv.rb +7 -5
  113. data/lib/fluent/plugin/formatter_out_file.rb +6 -4
  114. data/lib/fluent/plugin/formatter_single_value.rb +4 -2
  115. data/lib/fluent/plugin/formatter_stdout.rb +1 -1
  116. data/lib/fluent/plugin/formatter_tsv.rb +4 -2
  117. data/lib/fluent/plugin/in_dummy.rb +2 -123
  118. data/lib/fluent/plugin/in_exec.rb +4 -2
  119. data/lib/fluent/plugin/in_forward.rb +24 -6
  120. data/lib/fluent/plugin/in_gc_stat.rb +16 -0
  121. data/lib/fluent/plugin/in_http.rb +280 -119
  122. data/lib/fluent/plugin/in_monitor_agent.rb +122 -164
  123. data/lib/fluent/plugin/in_sample.rb +141 -0
  124. data/lib/fluent/plugin/in_syslog.rb +62 -16
  125. data/lib/fluent/plugin/in_tail/group_watch.rb +204 -0
  126. data/lib/fluent/plugin/in_tail/position_file.rb +255 -0
  127. data/lib/fluent/plugin/in_tail.rb +607 -369
  128. data/lib/fluent/plugin/in_tcp.rb +106 -9
  129. data/lib/fluent/plugin/in_udp.rb +9 -2
  130. data/lib/fluent/plugin/in_unix.rb +73 -79
  131. data/lib/fluent/plugin/input.rb +39 -1
  132. data/lib/fluent/plugin/metrics.rb +119 -0
  133. data/lib/fluent/plugin/metrics_local.rb +96 -0
  134. data/lib/fluent/plugin/multi_output.rb +45 -8
  135. data/lib/fluent/plugin/out_copy.rb +58 -7
  136. data/lib/fluent/plugin/out_exec_filter.rb +6 -4
  137. data/lib/fluent/plugin/out_file.rb +49 -35
  138. data/lib/fluent/plugin/out_forward/ack_handler.rb +161 -0
  139. data/lib/fluent/plugin/out_forward/connection_manager.rb +113 -0
  140. data/lib/fluent/plugin/out_forward/error.rb +28 -0
  141. data/lib/fluent/plugin/out_forward/failure_detector.rb +84 -0
  142. data/lib/fluent/plugin/out_forward/handshake_protocol.rb +125 -0
  143. data/lib/fluent/plugin/out_forward/load_balancer.rb +114 -0
  144. data/lib/fluent/plugin/out_forward/socket_cache.rb +142 -0
  145. data/lib/fluent/plugin/out_forward.rb +265 -402
  146. data/lib/fluent/plugin/out_http.rb +275 -0
  147. data/lib/fluent/plugin/out_secondary_file.rb +2 -4
  148. data/lib/fluent/plugin/out_stream.rb +1 -1
  149. data/lib/fluent/plugin/output.rb +190 -84
  150. data/lib/fluent/plugin/parser.rb +87 -4
  151. data/lib/fluent/plugin/parser_apache2.rb +1 -1
  152. data/lib/fluent/plugin/parser_csv.rb +75 -0
  153. data/lib/fluent/plugin/parser_json.rb +14 -6
  154. data/lib/fluent/plugin/parser_ltsv.rb +4 -2
  155. data/lib/fluent/plugin/parser_multiline.rb +49 -3
  156. data/lib/fluent/plugin/parser_none.rb +1 -2
  157. data/lib/fluent/plugin/parser_regexp.rb +4 -0
  158. data/lib/fluent/plugin/parser_syslog.rb +402 -48
  159. data/lib/fluent/plugin/sd_file.rb +156 -0
  160. data/lib/fluent/plugin/sd_srv.rb +135 -0
  161. data/lib/fluent/plugin/sd_static.rb +58 -0
  162. data/lib/fluent/plugin/service_discovery.rb +65 -0
  163. data/lib/fluent/plugin/storage_local.rb +12 -9
  164. data/lib/fluent/plugin.rb +24 -1
  165. data/lib/fluent/plugin_helper/cert_option.rb +26 -13
  166. data/lib/fluent/plugin_helper/child_process.rb +12 -7
  167. data/lib/fluent/plugin_helper/compat_parameters.rb +11 -1
  168. data/lib/fluent/plugin_helper/event_emitter.rb +8 -1
  169. data/lib/fluent/plugin_helper/extract.rb +1 -1
  170. data/lib/fluent/plugin_helper/formatter.rb +1 -1
  171. data/lib/fluent/plugin_helper/http_server/app.rb +79 -0
  172. data/lib/fluent/plugin_helper/http_server/compat/server.rb +92 -0
  173. data/lib/fluent/plugin_helper/http_server/compat/ssl_context_extractor.rb +52 -0
  174. data/lib/fluent/plugin_helper/http_server/compat/webrick_handler.rb +58 -0
  175. data/lib/fluent/plugin_helper/http_server/methods.rb +35 -0
  176. data/lib/fluent/plugin_helper/http_server/request.rb +42 -0
  177. data/lib/fluent/plugin_helper/http_server/router.rb +54 -0
  178. data/lib/fluent/plugin_helper/http_server/server.rb +93 -0
  179. data/lib/fluent/plugin_helper/http_server/ssl_context_builder.rb +41 -0
  180. data/lib/fluent/plugin_helper/http_server.rb +135 -0
  181. data/lib/fluent/plugin_helper/inject.rb +5 -2
  182. data/lib/fluent/plugin_helper/metrics.rb +129 -0
  183. data/lib/fluent/plugin_helper/parser.rb +1 -1
  184. data/lib/fluent/plugin_helper/record_accessor.rb +22 -25
  185. data/lib/fluent/plugin_helper/retry_state.rb +20 -10
  186. data/lib/fluent/plugin_helper/server.rb +61 -41
  187. data/lib/fluent/plugin_helper/service_discovery/manager.rb +146 -0
  188. data/lib/fluent/plugin_helper/service_discovery/round_robin_balancer.rb +43 -0
  189. data/lib/fluent/plugin_helper/service_discovery.rb +125 -0
  190. data/lib/fluent/plugin_helper/socket.rb +60 -16
  191. data/lib/fluent/plugin_helper/socket_option.rb +31 -5
  192. data/lib/fluent/plugin_helper/storage.rb +1 -1
  193. data/lib/fluent/plugin_helper/thread.rb +1 -0
  194. data/lib/fluent/plugin_helper.rb +3 -0
  195. data/lib/fluent/plugin_id.rb +17 -4
  196. data/lib/fluent/registry.rb +2 -1
  197. data/lib/fluent/root_agent.rb +60 -48
  198. data/lib/fluent/rpc.rb +4 -3
  199. data/lib/fluent/static_config_analysis.rb +194 -0
  200. data/lib/fluent/supervisor.rb +635 -267
  201. data/lib/fluent/system_config.rb +57 -55
  202. data/lib/fluent/test/driver/base.rb +4 -3
  203. data/lib/fluent/test/driver/base_owned.rb +15 -2
  204. data/lib/fluent/test/driver/storage.rb +30 -0
  205. data/lib/fluent/test/filter_test.rb +2 -2
  206. data/lib/fluent/test/output_test.rb +3 -3
  207. data/lib/fluent/time.rb +108 -17
  208. data/lib/fluent/timezone.rb +21 -7
  209. data/lib/fluent/tls.rb +81 -0
  210. data/lib/fluent/variable_store.rb +40 -0
  211. data/lib/fluent/version.rb +1 -1
  212. data/lib/fluent/win32api.rb +38 -0
  213. data/lib/fluent/winsvc.rb +27 -12
  214. data/templates/new_gem/fluent-plugin.gemspec.erb +3 -3
  215. data/templates/new_gem/lib/fluent/plugin/storage.rb.erb +40 -0
  216. data/templates/new_gem/test/plugin/test_storage.rb.erb +18 -0
  217. data/templates/plugin_config_formatter/param.md-table.erb +10 -0
  218. data/test/command/test_binlog_reader.rb +22 -6
  219. data/test/command/test_cap_ctl.rb +100 -0
  220. data/test/command/test_cat.rb +128 -0
  221. data/test/command/test_ctl.rb +56 -0
  222. data/test/command/test_fluentd.rb +327 -40
  223. data/test/command/test_plugin_config_formatter.rb +133 -11
  224. data/test/command/test_plugin_generator.rb +20 -3
  225. data/test/compat/test_parser.rb +2 -2
  226. data/test/config/test_config_parser.rb +49 -16
  227. data/test/config/test_configurable.rb +234 -42
  228. data/test/config/test_element.rb +48 -6
  229. data/test/config/test_literal_parser.rb +4 -0
  230. data/test/config/test_section.rb +9 -2
  231. data/test/config/test_system_config.rb +106 -89
  232. data/test/config/test_types.rb +300 -120
  233. data/test/counter/test_client.rb +8 -4
  234. data/test/counter/test_store.rb +2 -2
  235. data/test/helper.rb +2 -0
  236. data/test/helpers/fuzzy_assert.rb +89 -0
  237. data/test/helpers/process_extenstion.rb +33 -0
  238. data/test/plugin/data/sd_file/config +11 -0
  239. data/test/plugin/data/sd_file/config.json +17 -0
  240. data/test/plugin/data/sd_file/config.yaml +11 -0
  241. data/test/plugin/data/sd_file/config.yml +11 -0
  242. data/test/plugin/data/sd_file/invalid_config.yml +7 -0
  243. data/test/plugin/in_tail/test_fifo.rb +121 -0
  244. data/test/plugin/in_tail/test_io_handler.rb +150 -0
  245. data/test/plugin/in_tail/test_position_file.rb +316 -0
  246. data/test/plugin/out_forward/test_ack_handler.rb +101 -0
  247. data/test/plugin/out_forward/test_connection_manager.rb +145 -0
  248. data/test/plugin/out_forward/test_handshake_protocol.rb +112 -0
  249. data/test/plugin/out_forward/test_load_balancer.rb +106 -0
  250. data/test/plugin/out_forward/test_socket_cache.rb +174 -0
  251. data/test/plugin/test_bare_output.rb +14 -1
  252. data/test/plugin/test_base.rb +34 -0
  253. data/test/plugin/test_buf_file.rb +327 -19
  254. data/test/plugin/test_buf_file_single.rb +833 -0
  255. data/test/plugin/test_buffer.rb +216 -54
  256. data/test/plugin/test_buffer_file_chunk.rb +51 -24
  257. data/test/plugin/test_buffer_file_single_chunk.rb +611 -0
  258. data/test/plugin/test_buffer_memory_chunk.rb +1 -0
  259. data/test/plugin/test_compressable.rb +7 -4
  260. data/test/plugin/test_filter.rb +14 -3
  261. data/test/plugin/test_filter_parser.rb +2 -2
  262. data/test/plugin/test_filter_record_transformer.rb +1 -1
  263. data/test/plugin/test_filter_stdout.rb +8 -3
  264. data/test/plugin/test_formatter_csv.rb +25 -0
  265. data/test/plugin/test_formatter_hash.rb +6 -3
  266. data/test/plugin/test_formatter_json.rb +14 -4
  267. data/test/plugin/test_formatter_ltsv.rb +13 -5
  268. data/test/plugin/test_formatter_out_file.rb +35 -14
  269. data/test/plugin/test_formatter_single_value.rb +12 -6
  270. data/test/plugin/test_formatter_tsv.rb +12 -4
  271. data/test/plugin/test_in_exec.rb +27 -9
  272. data/test/plugin/test_in_forward.rb +159 -101
  273. data/test/plugin/test_in_gc_stat.rb +24 -1
  274. data/test/plugin/test_in_http.rb +341 -36
  275. data/test/plugin/test_in_monitor_agent.rb +390 -37
  276. data/test/plugin/test_in_object_space.rb +12 -10
  277. data/test/plugin/{test_in_dummy.rb → test_in_sample.rb} +35 -37
  278. data/test/plugin/test_in_syslog.rb +220 -50
  279. data/test/plugin/test_in_tail.rb +1534 -239
  280. data/test/plugin/test_in_tcp.rb +127 -23
  281. data/test/plugin/test_in_udp.rb +69 -31
  282. data/test/plugin/test_in_unix.rb +128 -73
  283. data/test/plugin/test_input.rb +12 -1
  284. data/test/plugin/test_metrics.rb +294 -0
  285. data/test/plugin/test_metrics_local.rb +96 -0
  286. data/test/plugin/test_multi_output.rb +25 -1
  287. data/test/plugin/test_out_copy.rb +138 -21
  288. data/test/plugin/test_out_exec.rb +6 -4
  289. data/test/plugin/test_out_exec_filter.rb +38 -45
  290. data/test/plugin/test_out_file.rb +106 -56
  291. data/test/plugin/test_out_forward.rb +588 -153
  292. data/test/plugin/test_out_http.rb +428 -0
  293. data/test/plugin/test_out_null.rb +1 -1
  294. data/test/plugin/test_out_secondary_file.rb +7 -5
  295. data/test/plugin/test_out_stdout.rb +38 -3
  296. data/test/plugin/test_out_stream.rb +21 -11
  297. data/test/plugin/test_output.rb +88 -7
  298. data/test/plugin/test_output_as_buffered.rb +46 -1
  299. data/test/plugin/test_output_as_buffered_backup.rb +58 -2
  300. data/test/plugin/test_output_as_buffered_overflow.rb +1 -1
  301. data/test/plugin/test_output_as_buffered_retries.rb +73 -16
  302. data/test/plugin/test_output_as_buffered_secondary.rb +13 -8
  303. data/test/plugin/test_parser.rb +40 -0
  304. data/test/plugin/test_parser_csv.rb +97 -0
  305. data/test/plugin/test_parser_json.rb +24 -0
  306. data/test/plugin/test_parser_labeled_tsv.rb +15 -0
  307. data/test/plugin/test_parser_multiline.rb +11 -0
  308. data/test/plugin/test_parser_regexp.rb +9 -0
  309. data/test/plugin/test_parser_syslog.rb +274 -65
  310. data/test/plugin/test_sd_file.rb +228 -0
  311. data/test/plugin/test_sd_srv.rb +230 -0
  312. data/test/plugin_helper/data/cert/cert-key.pem +27 -0
  313. data/test/plugin_helper/data/cert/cert-with-CRLF.pem +19 -0
  314. data/test/plugin_helper/data/cert/cert-with-no-newline.pem +19 -0
  315. data/test/plugin_helper/data/cert/cert.pem +19 -0
  316. data/test/plugin_helper/data/cert/cert_chains/ca-cert-key.pem +27 -0
  317. data/test/plugin_helper/data/cert/cert_chains/ca-cert.pem +20 -0
  318. data/test/plugin_helper/data/cert/cert_chains/cert-key.pem +27 -0
  319. data/test/plugin_helper/data/cert/cert_chains/cert.pem +40 -0
  320. data/test/plugin_helper/data/cert/empty.pem +0 -0
  321. data/test/plugin_helper/data/cert/generate_cert.rb +125 -0
  322. data/test/plugin_helper/data/cert/with_ca/ca-cert-key-pass.pem +30 -0
  323. data/test/plugin_helper/data/cert/with_ca/ca-cert-key.pem +27 -0
  324. data/test/plugin_helper/data/cert/with_ca/ca-cert-pass.pem +20 -0
  325. data/test/plugin_helper/data/cert/with_ca/ca-cert.pem +20 -0
  326. data/test/plugin_helper/data/cert/with_ca/cert-key-pass.pem +30 -0
  327. data/test/plugin_helper/data/cert/with_ca/cert-key.pem +27 -0
  328. data/test/plugin_helper/data/cert/with_ca/cert-pass.pem +21 -0
  329. data/test/plugin_helper/data/cert/with_ca/cert.pem +21 -0
  330. data/test/plugin_helper/data/cert/without_ca/cert-key-pass.pem +30 -0
  331. data/test/plugin_helper/data/cert/without_ca/cert-key.pem +27 -0
  332. data/test/plugin_helper/data/cert/without_ca/cert-pass.pem +20 -0
  333. data/test/plugin_helper/data/cert/without_ca/cert.pem +20 -0
  334. data/test/plugin_helper/http_server/test_app.rb +65 -0
  335. data/test/plugin_helper/http_server/test_route.rb +32 -0
  336. data/test/plugin_helper/service_discovery/test_manager.rb +93 -0
  337. data/test/plugin_helper/service_discovery/test_round_robin_balancer.rb +21 -0
  338. data/test/plugin_helper/test_cert_option.rb +25 -0
  339. data/test/plugin_helper/test_child_process.rb +121 -63
  340. data/test/plugin_helper/test_compat_parameters.rb +7 -2
  341. data/test/plugin_helper/test_event_emitter.rb +29 -0
  342. data/test/plugin_helper/test_http_server_helper.rb +372 -0
  343. data/test/plugin_helper/test_inject.rb +42 -0
  344. data/test/plugin_helper/test_metrics.rb +137 -0
  345. data/test/plugin_helper/test_record_accessor.rb +43 -2
  346. data/test/plugin_helper/test_retry_state.rb +602 -38
  347. data/test/plugin_helper/test_server.rb +272 -142
  348. data/test/plugin_helper/test_service_discovery.rb +165 -0
  349. data/test/plugin_helper/test_socket.rb +146 -0
  350. data/test/plugin_helper/test_timer.rb +13 -15
  351. data/test/test_capability.rb +74 -0
  352. data/test/test_config.rb +220 -9
  353. data/test/test_daemonizer.rb +91 -0
  354. data/test/test_engine.rb +203 -0
  355. data/test/test_event.rb +31 -15
  356. data/test/test_event_router.rb +17 -0
  357. data/test/test_event_time.rb +15 -2
  358. data/test/test_file_wrapper.rb +53 -0
  359. data/test/test_fluent_log_event_router.rb +99 -0
  360. data/test/test_formatter.rb +65 -11
  361. data/test/test_log.rb +137 -13
  362. data/test/test_logger_initializer.rb +46 -0
  363. data/test/test_match.rb +11 -0
  364. data/test/test_msgpack_factory.rb +18 -0
  365. data/test/test_oj_options.rb +55 -0
  366. data/test/test_output.rb +11 -6
  367. data/test/test_plugin.rb +1 -1
  368. data/test/test_plugin_classes.rb +102 -0
  369. data/test/test_plugin_id.rb +18 -0
  370. data/test/test_root_agent.rb +106 -3
  371. data/test/test_static_config_analysis.rb +177 -0
  372. data/test/test_supervisor.rb +483 -148
  373. data/test/test_test_drivers.rb +4 -3
  374. data/test/test_time_formatter.rb +140 -121
  375. data/test/test_time_parser.rb +139 -0
  376. data/test/test_tls.rb +65 -0
  377. data/test/test_variable_store.rb +65 -0
  378. metadata +292 -36
  379. data/.travis.yml +0 -63
  380. data/Vagrantfile +0 -17
  381. data/appveyor.yml +0 -43
  382. data/lib/fluent/plugin/file_wrapper.rb +0 -120
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4e5a7a4c71fe45e0a65fd941bea4093e8a6c5414
4
- data.tar.gz: 6e4000e2928c6bfda990ea5566e4e32618e031f7
2
+ SHA256:
3
+ metadata.gz: 0e7d3798a39136da859e23e8bee742d8db252f58ce410cc530710d60dba36c05
4
+ data.tar.gz: 82146c03770da1ebbad670fbd356a3020846f27d72e1eaeaed9538fc0b99c9cb
5
5
  SHA512:
6
- metadata.gz: 94194178c70c31f9ae8f20f4c85230f1479f53dfbd25e5e8a13e724a5cf8ca7b38a7658a97153838ff486d554d0f44369bf2f622838af324c585594a3748d76d
7
- data.tar.gz: 836807eb180ed4144f8333cb67c11d640b432882497e63d24d760a7a050f4513e137b6ac97bc6503d781e5690e80e26dee25792e6081b99f857f40787256e029
6
+ metadata.gz: 4b895809bf5e79c5fea8e5a77a485129d8a5912327fb7cbfc176a85e77918068cf24db37cf6e8fba53f24bbdb7e6af7d593a621bcad575faf4299589c8cb662c
7
+ data.tar.gz: a0985cfd48858c88f7ec9feb5c87e035361998ae50be98d6f486d9ae897cce350cf1878cd4a2491c40c6faa5a1cb67b3c52484d1100694bb624894635b8bebd6
data/.deepsource.toml ADDED
@@ -0,0 +1,13 @@
1
+ version = 1
2
+
3
+ test_patterns = ["test/**/test_*.rb"]
4
+
5
+ exclude_patterns = [
6
+ "bin/**",
7
+ "docs/**",
8
+ "example/**"
9
+ ]
10
+
11
+ [[analyzers]]
12
+ name = "ruby"
13
+ enabled = true
data/.drone.yml ADDED
@@ -0,0 +1,35 @@
1
+ kind: pipeline
2
+ name: fluentd-test-arm64-3-0
3
+
4
+ platform:
5
+ os: linux
6
+ arch: arm64
7
+
8
+ steps:
9
+ - name: fluentd-test-arm64-3-0
10
+ image: arm64v8/ruby:3.0
11
+ commands:
12
+ - apt update
13
+ - apt -y install libgmp3-dev
14
+ - export BUNDLE_GEMFILE=$PWD/Gemfile
15
+ - gem update --system
16
+ - bundle install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}
17
+ - bundle exec rake test
18
+ ---
19
+ kind: pipeline
20
+ name: fluentd-test-arm64-2-7
21
+
22
+ platform:
23
+ os: linux
24
+ arch: arm64
25
+
26
+ steps:
27
+ - name: fluentd-test-arm64-2-7
28
+ image: arm64v8/ruby:2.7
29
+ commands:
30
+ - apt update
31
+ - apt -y install libgmp3-dev
32
+ - export BUNDLE_GEMFILE=$PWD/Gemfile
33
+ - gem update --system
34
+ - bundle install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}
35
+ - bundle exec rake test
@@ -0,0 +1,70 @@
1
+ name: Bug Report
2
+ description: Create a report with a procedure for reproducing the bug
3
+ body:
4
+ - type: markdown
5
+ attributes:
6
+ value: |
7
+ Check [CONTRIBUTING guideline](https://github.com/fluent/fluentd/blob/master/CONTRIBUTING.md) first and here is the list to help us investigate the problem.
8
+ - type: textarea
9
+ id: description
10
+ attributes:
11
+ label: Describe the bug
12
+ description: A clear and concise description of what the bug is
13
+ validations:
14
+ required: true
15
+ - type: textarea
16
+ id: reproduce
17
+ attributes:
18
+ label: To Reproduce
19
+ description: Steps to reproduce the behavior
20
+ validations:
21
+ required: true
22
+ - type: textarea
23
+ id: expected
24
+ attributes:
25
+ label: Expected behavior
26
+ description: A clear and concise description of what you expected to happen
27
+ validations:
28
+ required: true
29
+ - type: textarea
30
+ id: environment
31
+ attributes:
32
+ label: Your Environment
33
+ description: |
34
+ - Fluentd or td-agent version: `fluentd --version` or `td-agent --version`
35
+ - Operating system: `cat /etc/os-release`
36
+ - Kernel version: `uname -r`
37
+
38
+ Tip: If you hit the problem with older fluentd version, try latest version first.
39
+ value: |
40
+ - Fluentd version:
41
+ - TD Agent version:
42
+ - Operating system:
43
+ - Kernel version:
44
+ render: markdown
45
+ validations:
46
+ required: true
47
+ - type: textarea
48
+ id: configuration
49
+ attributes:
50
+ label: Your Configuration
51
+ description: |
52
+ Write your configuration here. Minimum reproducible fluentd.conf is recommended.
53
+ render: apache
54
+ validations:
55
+ required: true
56
+ - type: textarea
57
+ id: logs
58
+ attributes:
59
+ label: Your Error Log
60
+ description: Write your ALL error log here
61
+ render: shell
62
+ validations:
63
+ required: true
64
+ - type: textarea
65
+ id: addtional-context
66
+ attributes:
67
+ label: Additional context
68
+ description: Add any other context about the problem here.
69
+ validations:
70
+ required: false
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Ask a Question
4
+ url: https://github.com/fluent/fluentd/discussions
5
+ about: I have questions about Fluentd and plugins. Please ask and answer questions at https://github.com/fluent/fluentd/discussions
@@ -0,0 +1,38 @@
1
+ name: Feature request
2
+ description: Suggest an idea for this project
3
+ body:
4
+ - type: markdown
5
+ attributes:
6
+ value: |
7
+ Check [CONTRIBUTING guideline](https://github.com/fluent/fluentd/blob/master/CONTRIBUTING.md) first and here is the list to help us investigate the problem.
8
+ - type: textarea
9
+ id: description
10
+ attributes:
11
+ label: Is your feature request related to a problem? Please describe.
12
+ description: |
13
+ A clear and concise description of what the problem is.
14
+ Ex. I'm always frustrated when [...]
15
+ validations:
16
+ required: true
17
+ - type: textarea
18
+ id: solution
19
+ attributes:
20
+ label: Describe the solution you'd like
21
+ description: A clear and concise description of what you want to happen.
22
+ validations:
23
+ required: true
24
+ - type: textarea
25
+ id: alternative
26
+ attributes:
27
+ label: Describe alternatives you've considered
28
+ description: A clear and concise description of any alternative solutions or features you've considered.
29
+ validations:
30
+ required: true
31
+ - type: textarea
32
+ id: addtional-context
33
+ attributes:
34
+ label: Additional context
35
+ description: Add any other context or screenshots about the feature request here.
36
+ validations:
37
+ required: false
38
+
@@ -1,6 +1,17 @@
1
1
  Check [CONTRIBUTING guideline](https://github.com/fluent/fluentd/blob/master/CONTRIBUTING.md) first and here is the list to help us investigate the problem.
2
2
 
3
- - fluentd or td-agent version.
4
- - Environment information, e.g. OS.
5
- - Your configuration
6
- - Your problem explanation. If you have an error logs, write it together.
3
+ **Got a question or problem?**
4
+
5
+ RESOURCES of [Official site](https://www.fluentd.org/) and [Fluentd documentation](https://docs.fluentd.org/) may help you.
6
+
7
+ If you have further questions about Fluentd and plugins, please direct these to [Mailing List](https://groups.google.com/forum/#!forum/fluentd).
8
+ Don't use Github issue for asking questions. Here are examples:
9
+
10
+ - I installed xxx plugin but it doesn't work. Why?
11
+ - Fluentd starts but logs are not sent to xxx. Am I wrong?
12
+ - I want to do xxx. How to realize it with plugins?
13
+
14
+ We may close such questions to keep clear repository for developers and users.
15
+ Github issue is mainly for submitting a bug report or feature request. See below.
16
+
17
+ If you can't judge your case is a bug or not, use mailing list or slack first.
@@ -0,0 +1,14 @@
1
+ <!--
2
+ Thank you for contributing to Fluentd!
3
+ Your commits need to follow DCO: https://probot.github.io/apps/dco/
4
+ And please provide the following information to help us make the most of your pull request:
5
+ -->
6
+
7
+ **Which issue(s) this PR fixes**:
8
+ Fixes #
9
+
10
+ **What this PR does / why we need it**:
11
+
12
+ **Docs Changes**:
13
+
14
+ **Release Note**:
@@ -0,0 +1,36 @@
1
+ name: Testing on Ubuntu
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ continue-on-error: ${{ matrix.experimental }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ ruby-version: ['3.1', '3.0', '2.7']
17
+ os: [ubuntu-latest]
18
+ experimental: [false]
19
+ include:
20
+ - ruby-version: head
21
+ os: ubuntu-latest
22
+ experimental: true
23
+
24
+ name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
25
+ steps:
26
+ - uses: actions/checkout@v2
27
+ - name: Set up Ruby
28
+ uses: ruby/setup-ruby@v1
29
+ with:
30
+ ruby-version: ${{ matrix.ruby-version }}
31
+ - name: Install addons
32
+ run: sudo apt-get install libgmp3-dev libcap-ng-dev
33
+ - name: Install dependencies
34
+ run: bundle install
35
+ - name: Run tests
36
+ run: bundle exec rake test
@@ -0,0 +1,34 @@
1
+ name: Testing on macOS
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ continue-on-error: ${{ matrix.experimental }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ ruby-version: ['3.1', '3.0', '2.7']
17
+ os: [macos-latest]
18
+ experimental: [true]
19
+ include:
20
+ - ruby-version: head
21
+ os: macos-latest
22
+ experimental: true
23
+
24
+ name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
25
+ steps:
26
+ - uses: actions/checkout@v2
27
+ - name: Set up Ruby
28
+ uses: ruby/setup-ruby@v1
29
+ with:
30
+ ruby-version: ${{ matrix.ruby-version }}
31
+ - name: Install dependencies
32
+ run: bundle install
33
+ - name: Run tests
34
+ run: bundle exec rake test
@@ -0,0 +1,49 @@
1
+ name: Testing on Windows
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ continue-on-error: ${{ matrix.experimental }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ ruby-version: ['3.1', '2.7']
17
+ os:
18
+ - windows-latest
19
+ experimental: [false]
20
+ include:
21
+ - ruby-version: head
22
+ os: windows-latest
23
+ experimental: true
24
+ - ruby-version: '3.0.3'
25
+ os: windows-latest
26
+ experimental: false
27
+ # On Ruby 3.0, we need to use fiddle 1.0.8 or later to retrieve correct
28
+ # error code. In addition, we have to specify the path of fiddle by RUBYLIB
29
+ # because RubyInstaller loads Ruby's bundled fiddle before initializing gem.
30
+ # See also:
31
+ # * https://github.com/ruby/fiddle/issues/72
32
+ # * https://bugs.ruby-lang.org/issues/17813
33
+ # * https://github.com/oneclick/rubyinstaller2/blob/8225034c22152d8195bc0aabc42a956c79d6c712/lib/ruby_installer/build/dll_directory.rb
34
+ ruby-lib-opt: RUBYLIB=%RUNNER_TOOL_CACHE%/Ruby/3.0.3/x64/lib/ruby/gems/3.0.0/gems/fiddle-1.1.0/lib
35
+
36
+ name: Unit testing with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }}
37
+ steps:
38
+ - uses: actions/checkout@v2
39
+ - name: Set up Ruby
40
+ uses: ruby/setup-ruby@v1
41
+ with:
42
+ ruby-version: ${{ matrix.ruby-version }}
43
+ - name: Add Fiddle 1.1.0
44
+ if: ${{ matrix.ruby-version == '3.0.3' }}
45
+ run: gem install fiddle --version 1.1.0
46
+ - name: Install dependencies
47
+ run: ridk exec bundle install
48
+ - name: Run tests
49
+ run: bundle exec rake test TESTOPTS=-v ${{ matrix.ruby-lib-opt }}
data/.gitignore CHANGED
@@ -25,4 +25,6 @@ Gemfile.local
25
25
  coverage/*
26
26
  .vagrant/
27
27
  cov-int/
28
- cov-fluentd.tar.gz
28
+ cov-fluentd.tar.gz
29
+ .vscode
30
+ .idea/
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,103 @@
1
+ .install-template:
2
+ before_script:
3
+ - gem update --system
4
+ - ruby -v
5
+
6
+ .test-template:
7
+ before_script:
8
+ - gem install rake
9
+ - bundle install
10
+ - chmod 777 -R ./test
11
+
12
+ stages:
13
+ - build
14
+ - tests
15
+
16
+ 2-6-6:
17
+ image: "ruby:2.6.6"
18
+ stage: build
19
+ extends: .install-template
20
+ script:
21
+ - bundle install --jobs=3 --retry=3
22
+ cache:
23
+ key: "$CI_COMMIT_REF_SLUG 2-6-6"
24
+ paths:
25
+
26
+ 2-7-2:
27
+ image: "ruby:2.7.2"
28
+ stage: build
29
+ extends: .install-template
30
+ script:
31
+ - bundle install --jobs=3 --retry=3
32
+ cache:
33
+ key: "$CI_COMMIT_REF_SLUG 2-7-2"
34
+ paths:
35
+
36
+ 3-0-0:
37
+ image: "ruby:3.0.0"
38
+ stage: build
39
+ extends: .install-template
40
+ script:
41
+ - bundle install --jobs=3 --retry=3
42
+ cache:
43
+ key: "$CI_COMMIT_REF_SLUG 3-0-0"
44
+ paths:
45
+
46
+ rubyhead:
47
+ image: "ruby:latest"
48
+ stage: build
49
+ extends: .install-template
50
+ script:
51
+ - bundle install --jobs=3 --retry=3
52
+ cache:
53
+ key: "$CI_COMMIT_REF_SLUG latest"
54
+ paths:
55
+ - ./*
56
+
57
+ 2-6-6-test:
58
+ image: "ruby:2.6.6"
59
+ stage: tests
60
+ allow_failure: true
61
+ extends: .test-template
62
+ script:
63
+ - bundle exec rake test
64
+ cache:
65
+ key: "$CI_COMMIT_REF_SLUG 2-6-6"
66
+ paths:
67
+ - ./*
68
+
69
+ 2-7-2-test:
70
+ image: "ruby:2.7.2"
71
+ stage: tests
72
+ allow_failure: true
73
+ extends: .test-template
74
+ script:
75
+ - bundle exec rake test
76
+ cache:
77
+ key: "$CI_COMMIT_REF_SLUG 2-7-2"
78
+ paths:
79
+ - ./*
80
+
81
+ 3-0-0-test:
82
+ image: "ruby:3.0.0"
83
+ stage: tests
84
+ allow_failure: true
85
+ extends: .test-template
86
+ script:
87
+ - bundle exec rake test
88
+ cache:
89
+ key: "$CI_COMMIT_REF_SLUG 3-0-0"
90
+ paths:
91
+ - ./*
92
+
93
+ rubyhead-test:
94
+ image: "ruby:latest"
95
+ stage: tests
96
+ allow_failure: true
97
+ extends: .test-template
98
+ script:
99
+ - bundle exec rake test
100
+ cache:
101
+ key: "$CI_COMMIT_REF_SLUG latest"
102
+ paths:
103
+ - ./*