in_tcp and in_syslog fail with LoadError unless oj gem is installed
Describe the bug
Unless I install oj gem then I get: 2024-01-16 17:08:59 +0000 [warn]: [in_tcp] LoadError 2024-01-16 17:08:59 +0000 [warn]: [in_syslog] LoadError
and my logs fail to ship
To Reproduce
<source>
@type tcp
@id in_tcp
tag my_json
port 24226
bind 0.0.0.0
<parse>
@type json
</parse>
</source>
Expected behavior
gem install fluentd should have the required gems in order to run
Your Environment
- Fluentd version: 1.16.3
- TD Agent version:
- Operating system: amazonlinux:2023
- Kernel version:
Your Configuration
<source>
@type tcp
@id in_tcp
tag my_json
port 24226
bind 0.0.0.0
<parse>
@type json
</parse>
</source>
<source>
@type syslog
@id in_syslog
tag my_syslog
port 24227
bind 0.0.0.0
<parse>
@type json
</parse>
</source>
Your Error Log
2024-01-16 17:08:59 +0000 [warn]: [in_tcp] LoadError
2024-01-16 17:08:59 +0000 [warn]: [in_syslog] LoadError
Additional context
https://rubygems.org/gems/fluentd
says oj is a development but not runtime requirement, seems a runtime requirement to me
Even though oj is not runtime requirement, but try to load whether it is available or not.
If oj is not available, it fallback to yajl.
https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin/parser_json.rb#L50-L66
But it seems that fallback doesn't succeed.
Is yajl or json available on your environment?
If I add both but not oj
gem install yajl json
It still fails with loaderror
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 7 days
This issue was automatically closed because of stale in 7 days