i would like to extend logstash-input-jdbc so i download it to my local directory. and then i do following things.
-
rename the directory from logstash-input-jdbc to logstash-input-ias_person
-
rename lib/logstash/inputs/jdbc.ruby to lib/logstash/inputs/ias_person.ruby
-
rename class name from Jdbc to Ias_Person
-
change config_name to "ias_person"
-
change logstash-input-jdbc.gemspec to logstash-input-ias_person.gemspec
-
gem build logstash-input-ias_person.gemspec then i get a logstash-input-ias_person-4.2.2.gem
-
install this new plugin (yes, i just rename it for the first step) by command logstash-plugin install logstash-input-ias_person-4.2.2.gem. it shows validating, and installing and then succeed.
-
run command logstash-plugin list, i can see my logstash-input-ias_person in output.
-
open logstash/Gemfile, i see this line: gem "logstash-input-ias_person", "4.2.2", :path => "vendor/local_gems/89ca0712/logstash-input-ias_person-4.2.2"
-
so far so good! BUT when i try to use it. (just by replace jdbc plugin to ias_person in a verified working logstash conf file). i get this error:
[2017-08-18T15:26:16,713][ERROR][logstash.plugins.registry] Problems loading a plugin with {:type=>"input", :name=>"ias_person", :path=>"logstash/inputs/ias_person", :error_message=>"NameError", :error_class=>NameError, :error_backtrace=>["c:/ElastiscSearch/logstash/logstash-core/lib/logstash/plugins/registry.rb:226:innamespace_lookup'", "c:/ElastiscSearch/logstash/logstash-core/lib/logstash/plugins/registry.rb:162:in
legacy_lookup'", "c:/ElastiscSearch/logstash/logstash-core/lib/logstash/plugins/registry.rb:138:inlookup'", "c:/ElastiscSearch/logstash/logstash-core/lib/logstash/plugins/registry.rb:180:in
lookup_pipeline_plugin'", "c:/ElastiscSearch/logstash/logstash-core/lib/logstash/plugin.rb:140:inlookup'", "c:/ElastiscSearch/logstash/logstash-core/lib/logstash/pipeline.rb:100:in
plugin'", "(eval):8:ininitialize'", "org/jruby/RubyKernel.java:1079:in
eval'", "c:/ElastiscSearch/logstash/logstash-core/lib/logstash/pipeline.rb:72:ininitialize'", "c:/ElastiscSearch/logstash/logstash-core/lib/logstash/pipeline.rb:156:in
initialize'", "c:/ElastiscSearch/logstash/logstash-core/lib/logstash/agent.rb:286:increate_pipeline'", "c:/ElastiscSearch/logstash/logstash-core/lib/logstash/agent.rb:95:in
register_pipeline'", "c:/ElastiscSearch/logstash/logstash-core/lib/logstash/runner.rb:314:inexecute'", "c:/ElastiscSearch/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in
run'", "c:/ElastiscSearch/logstash/logstash-core/lib/logstash/runner.rb:209:inrun'", "c:/ElastiscSearch/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in
run'", "c:\ElastiscSearch\logstash\lib\bootstrap\environment.rb:71:in `(root)'"]}
[2017-08-18T15:26:16,729][ERROR][logstash.agent ] Cannot create pipeline {:reason=>"Couldn't find any input plugin named 'ias_person'. Are you sure this is correct? Trying to load the ias_person input plugin resulted in this error: Problems loading the requested plugin named ias_person of type input. Error: NameError NameError"}
I GUESS, it trys to load plugin from "logstash/inputs/ias_person"???
Doesn't logstash/Gemfile shows it is at "vendor/local_gems/89ca0712/logstash-input-ias_person-4.2.2"??