bpaquet / node-logstash

Simple logstash implmentation in nodejs : file log collection, sent with zeromq
Other
517 stars 141 forks source link

Custom plugins issue #144

Open kostaatsk opened 7 years ago

kostaatsk commented 7 years ago

Hello,

There seems to be an issue with the documentation instructions for custom plugins

It says: In the plugin code, you can reference base plugins with var base_filter = require('lib/base_filter');

Unfortunately you cannot do that because base_filter.js requires './base_component' and it will not be found as a relative file to your /var/my_plugins/filters or /var/db/node-logstash/custom_plugins/filters

For example if you try to require('lib/base_filter_buffer'), base_filter_buffer will be required because it exists in NODE_PATH but you will get the following error because base_filter_buffer extends base_filter

ERROR Error: Cannot find module './base_filter'

As a temporary solution, I am deploying my custom filters to /opt/node-logstash/lib/filters/ but it would be nice if you can correct this or find a better solution