td-agent installing custom plugin

2,417 views
Skip to first unread message

Jay Wilson

unread,
Dec 13, 2013, 12:11:14 PM12/13/13
to flu...@googlegroups.com
I have read the how to write a plugin for fluent. It says that the plugin needs to be lib/fluent/plugin, but I installed td-agent and I don't have a plugin directory anywhere on my system.

I have a gemspec and rb created
  . fluent-plugin-jnpr-0.1.0.gemspec
  . in_jnpr.rb

Where do I need to put these on my system for "fluent-gem install" to process them?

My directory structure is

./usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/

If I look at a plugin like mongo I can see this path

./usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluent-plugin-mongo-0.7.1/lib/fluent/plugin

but I also see the specification for mongo at this path

/usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/specifications

So would I put my specification at the above path and then create a path like /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluent-plugin-jnpr-0.1.0/lib/fluent/plugin and put in_jnpr.rb in it? If I do all of that manually than I assume I don't need to do a "fluent-gem install", correct?


Jay Wilson

unread,
Dec 13, 2013, 11:28:41 PM12/13/13
to flu...@googlegroups.com
problem resolved and my plugin is now working.

Thank you everyone for all the help.

Masahiro Nakagawa

unread,
Dec 14, 2013, 10:24:51 AM12/14/13
to flu...@googlegroups.com
FYI:


> To install a plugin, please put the ruby script in the /etc/fluent/plugin directory.

In fluentd, above directory is a plugin place.
In td-agent, /etc/td-agent/plugin is a plugin place too.

/etc/fluent/plugin/in_jnpr.rb for fluentd
/etc/td-agent/plugin/in_jnpr.rb for td-agent

Another approach uses fluent-gem to install local gem.

/path/to/fluent-gem install /path/to/fluent-plugin-jnpr-0.1.0.gem




--
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages