Describe the bug
Events except those in the first chunk are not written to files when append is true for out_file plugin.
To Reproduce
- Run
fluentd --setup to generate fluent.conf.
- Put the following content into
fluent.conf.
<match hack.**>
@type file
path hack
append true
<format>
@type json
</format>
<buffer>
flush_mode immediate
</buffer>
</match>
- Run the following command in a terminal:
$ curl -X POST http://localhost:8888/hack.access -d 'json={"no":"1"}'
$ cat hack.20211202.log
{"no":"1"}
$ curl -X POST http://localhost:8888/hack.access -d 'json={"no":"2"}'
$ cat hack.20211202.log
{"no":"1"}
Expected behavior
The content of hack.20211202.log should be:
but was:
Your Environment
- Fluentd version: 1.14.3
- TD Agent version: 1.14.3
- Operating system: macOS 10.15.5
- Kernel version: 19.5.0
- Ruby version:
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin19]
I have used Ruby gem to install Fluentd.
Your Configuration
<match hack.**>
@type file
path hack
append true
<format>
@type json
</format>
<buffer>
flush_mode immediate
</buffer>
</match>
Your Error Log
Additional context
I have verified that fluentd 1.14.3 which uses ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux] does not have this prolem on CentOS Linux release 7.5.1804 (Core). On macOS, I have tried two Ruby 2.x versions. Here is the result:
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19] does not have this problem.
ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-darwin19] has this problem.
Describe the bug
Events except those in the first chunk are not written to files when
appendis true forout_fileplugin.To Reproduce
fluentd --setupto generatefluent.conf.fluent.conf.Expected behavior
The content of
hack.20211202.logshould be:but was:
Your Environment
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin19]I have used Ruby
gemto install Fluentd.Your Configuration
<match hack.**> @type file path hack append true <format> @type json </format> <buffer> flush_mode immediate </buffer> </match>Your Error Log
Additional context
I have verified that
fluentd 1.14.3which usesruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]does not have this prolem onCentOS Linux release 7.5.1804 (Core). On macOS, I have tried two Ruby 2.x versions. Here is the result:ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]does not have this problem.ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-darwin19]has this problem.