fluent-plugin-mongo
fluent-plugin-mongo copied to clipboard
Fluentd-elasticsearch image with mongo plugin
Hello people of the future (including future self and search-engines).
Using the Stable Kubernetes Helm chart of Fluentd-Elasticsearch, it is not possible to install fluent-plugin-mongo using the values.yaml definition plugins.pluginList.
This happens as the plugin contains native components (that cannot be built as the existing container does not have building tools).
To fix that I created the following docker image, based on gcr.io/google-containers/fluentd-elasticsearch, which has the fluent-plugin-mongo installed, and ready to be used with <source> and <match>.
Here it is for everyone to use: https://hub.docker.com/r/operatorequals/fluentd-elasticsearch
This will be useful to you if you see the following error:
Building native extensions. This could take a while...
ERROR: Error installing fluent-plugin-mongo:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/bson-4.11.0/ext/bson
/usr/bin/ruby2.3 -r ./siteconf20201028-7-1x8eqay.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.3.0/gems/bson-4.11.0 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/bson-4.11.0/gem_make.out
2020-10-28 21:16:06 +0000 [info]: parsing config file is succeeded path="/etc/fluent/fluent.conf"
2020-10-28 21:16:06 +0000 [error]: config error file="/etc/fluent/fluent.conf" error_class=Fluent::ConfigError error="Unknown output plugin 'mongo'. Run 'gem search -rd fluent-plugin' to find plugins"