Logstash outout to Elastic search


(Shashank Jain) #1

Hi All,

I am trying to send logstash output to Elastic Search Cluster ,

below the i am defining

output {

            elasticsearch {
                               hosts => ["node1:9200 , node2:9200  , node3:9200"]
                                index => "kafka"
                           }
   }

but getting below exception while starting logstash ,

[2017-12-28T17:01:56,915][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"Java::JavaNet::URISyntaxException", :message=>"Illegal character in opaque part at index 29: node1:9200 , node2:9200 , node3:9200", :backtrace=>["java.net.URI$Parser.fail(java/net/URI.java:2848)", "java.net.URI$Parser.checkChars(java/net/URI.java:3021)", "java.net.URI$Parser.parse(java/net/URI.java:3058)", "java.net.URI.(java/net/URI.java:588)", "java.lang.reflect.Constructor.newInstance(java/lang/reflect/Constructor.java:423)", "org.jruby.javasupport.JavaConstructor.newInstanceDirect(org/jruby/javasupport/JavaConstructor.java:278)", "org.jruby.RubyClass.newInstance(org/jruby/RubyClass.java:1001)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen)", "RUBY.initialize(/usr/share/logstash/logstash-core/lib/logstash/util/safe_uri.rb:22)", "org.jruby.RubyClass.newInstance(org/jruby/RubyClass.java:1001)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen)", "RUBY.validate_value(/usr/share/logstash/logstash-core/lib/logstash/config/mixin.rb:516)", "RUBY.block in process_parameter_value(/usr/share/logstash/logstash-core/lib/logstash/config/mixin.rb:331)", "org.jruby.RubyArray.collect(org/jruby/RubyArray.java:2472)", "org.jruby.RubyArray.map(org/jruby/RubyArray.java:2486)", "org.jruby.RubyArray$INVOKER$i$0$0$map19.call(org/jruby/RubyArray$INVOKER$i$0$0$map19.gen)", "RUBY.process_parameter_value(/usr/share/logstash/logstash-core/lib/logstash/config/mixin.rb:331)", "usr.share.logstash.logstash_minus_core.lib.logstash.config.mixin.invokeOther6:process_parameter_value(usr/share/logstash/logstash_minus_core/lib/logstash/config//usr/share/logstash/logstash-core/lib/logstash/config/mixin.rb:354)", "usr.share.logstash.logstash_minus_core.lib.logstash.config.mixin.block in validate_check_parameter_values(/usr/share/logstash/logstash-core/lib/logstash/config/mixin.rb:354)", "org.jruby.RubyArray.each(org/jruby/RubyArray.java:1734)", "org.jruby.RubyArray$INVOKER$i$0$0$each.call(org/jruby/RubyArray$INVOKER$i$0$0$each.gen)", "RUBY.block in validate_check_parameter_values(/usr/share/logstash/logstash-core/lib/logstash/config/mixin.rb:348)", "org.jruby.RubyHash$12.visit(org/jruby/RubyHash.java:1362)", "org.jruby.RubyHash$12.visit(org/jruby/RubyHash.java:1359)", "org.jruby.RubyHash.visitLimited(org/jruby/RubyHash.java:662)", "org.jruby.RubyHash.visitAll(org/jruby/RubyHash.java:647)", "org.jruby.RubyHash.iteratorVisitAll(org/jruby/RubyHash.java:1319)", "org.jruby.RubyHash.each_pairCommon(org/jruby/RubyHash.java:1354)", "org.jruby.RubyHash.each(org/jruby/RubyHash.java:1343)", "org.jruby.RubyHash$INVOKER$i$0$0$each.call(org/jruby/RubyHash$INVOKER$i$0$0$each.gen)", "RUBY.validate_check_parameter_values(/usr/share/logstash/logstash-core/lib/logstash/config/mixin.rb:347)", "RUBY.validate(/usr/share/logstash/logstash-core/lib/logstash/config/mixin.rb:237)", "RUBY.config_init(/usr/share/logstash/logstash-core/lib/logstash/config/mixin.rb:88)", "RUBY.initialize(/usr/share/logstash/logstash-core/lib/logstash/outputs/base.rb:63)", "org.jruby.RubyClass.newInstance(org/jruby/RubyClass.java:1001)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen)", "RUBY.initialize(/usr/share/logstash/logstash-core/lib/logstash/output_delegator_strategies/shared.rb:3)", "org.jruby.RubyClass.newInstance(org/jruby/RubyClass.java:1022)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen)", "RUBY.initialize(/usr/share/logstash/logstash-core/lib/logstash/output_delegator.rb:25)", "org.jruby.RubyClass.newInstance(org/jruby/RubyClass.java:1022)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen)", "RUBY.plugin(/usr/share/logstash/logstash-core/lib/logstash/plugins/plugin_factory.rb:86)", "RUBY.plugin(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:114)", "RUBY.((eval):39)", "org.jruby.RubyKernel.evalCommon(org/jruby/RubyKernel.java:1027)", "org.jruby.RubyKernel.eval(org/jruby/RubyKernel.java:994)", "org.jruby.RubyKernel$INVOKER$s$0$3$eval19.call(org/jruby/RubyKernel$INVOKER$s$0$3$eval19.gen)", "RUBY.initialize(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:86)", "RUBY.initialize(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:171)", "org.jruby.RubyClass.newInstance(org/jruby/RubyClass.java:1022)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen)", "RUBY.execute(/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:40)", "RUBY.block in converge_state(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:335)", "RUBY.with_pipelines(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:141)", "RUBY.block in converge_state(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:332)", "org.jruby.RubyArray.each(org/jruby/RubyArray.java:1734)", "org.jruby.RubyArray$INVOKER$i$0$0$each.call(org/jruby/RubyArray$INVOKER$i$0$0$each.gen)", "RUBY.converge_state(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:319)", "RUBY.block in converge_state_and_update(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:166)", "RUBY.with_pipelines(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:141)", "RUBY.converge_state_and_update(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:164)", "RUBY.execute(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:90)", "RUBY.block in execute(/usr/share/logstash/logstash-core/lib/logstash/runner.rb:343)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)", "org.jruby.RubyProc.call19(org/jruby/RubyProc.java:273)", "org.jruby.RubyProc$INVOKER$i$0$0$call19.call(org/jruby/RubyProc$INVOKER$i$0$0$call19.gen)", "RUBY.block in initialize(/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:246)", "java.lang.Thread.run(java/lang/Thread.java:748)"]}
[2017-12-28T17:01:56,918][ERROR][logstash.agent ] An exception happened when con

please help in resolving the same .


(Christian Dahlqvist) #2

If you look at the documentation, hosts takes a list of host strings. What you have provided is a list containing a single string with hosts and port combinations separated by commas, which is not a valid format.


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.