Fluentd version upgrade no longer recognizes Fluent::S3 Output used by plugins

Asked 2 years ago, Updated 2 years ago, 143 views

US>
on systems sending API server logs to AWS S3 by fluentd I'm going to upgrade from td-agent 0.12.40 to 1.6.3

The upgrade of the main unit itself is over, but
The following plug-ins in /etc/td-agent/plugin/ are

module Fluent
  require 'fluent/plugin/out_s3'
  require 'yajl'

  classCustomS3Output<S3Output

    Plugin.register_output('custom_s3',self)

    def write(chunk)
      :
     (omitted)
      :
    e n d
  e n d
e n d
/etc/td-agent/plugin/out_s3.rb:9:in`<module:Fluent>':uninitialized constantFluent:::S3Output(NameError)

Now I'm wearing the error

Fluent::S3Output means
https://github.com/fluent/fluent-plugin-s3
of
https://github.com/fluent/fluent-plugin-s3/blob/master/lib/fluent/plugin/out_s3.rb
I think you mean

/opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-s3

The Gem installation was successful, but the error did not change

Before the version upgrade, the code worked as it was, so
Did the upgrade change the way you installed and recognized the gem?

At the end of the site

moduleFluent#SinceFluent-plugin-s3 v1.0.0 or later, useFluent::Plugin installed of Fluent

The first line says

 module Fluent::Plugin

I tried to change it to

/etc/td-agent/plugin/out_s3.rb:11:in`<class:CustomS3Output>':uninitialized constantFluent::Plugin::CustomS3Output:::Plugin(NameError)

The error appears

If anyone knows the cause, I would appreciate it if you could help me.
Thank you for your cooperation

rubygems fluentd

2022-09-30 21:44

1 Answers

The plug-in namespace has changed due to the version upgrade of Fluentd and Fluent-plugin-s3, which results in an error.

I think custom_s3 in /etc/td-agent/plugin/ will work if you do the following:

module Fluent
  module plugin
    classCustomS3Output<Fluent::Plugin::S3Output
      Fluent::Plugin.register_output(self, "custom_s3")
      # ...
    e n d
  e n d
e n d

The API of the plug-in has changed, so this may not work.
In that case, use the document to make sure that custom_s3 also uses the v1 API.
Also, depending on the modifications, the new version of the fluid-plugin-s3 may work as it is, so please check it out.


2022-09-30 21:44

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.