Error "Unknown setting 'protocol' for elasticsearch"


I have installed Logstash 2.3.1 and logstash-output-elasticsearch_java.gem because I would like to use the options: protocol, cluster and node_name in my output. When Logstash starts I receive the next error:

{:timestamp=>"2016-05-05T09:11:45.725000+0200", :message=>"Unknown setting 'protocol' for elasticsearch", :level=>:error}
{:timestamp=>"2016-05-05T09:11:45.726000+0200", :message=>"Unknown setting 'cluster' for elasticsearch", :level=>:error}
{:timestamp=>"2016-05-05T09:11:45.729000+0200", :message=>"Pipeline aborted due to error", :exception=>#<LogStash::ConfigurationError: Something is wrong with your configuration.>, :backtrace=>["/soft/sth/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.1-java/lib/logstash/config/mixin.rb:134:in `config_init'", "/soft/sth/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.1-java/lib/logstash/outputs/base.rb:63:in `initialize'", "/soft/sth/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.1-java/lib/logstash/output_delegator.rb:74:in `register'", "/soft/sth/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.1-java/lib/logstash/pipeline.rb:181:in `start_workers'", "org/jruby/ `each'", "/soft/sth/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.1-java/lib/logstash/pipeline.rb:181:in `start_workers'", "/soft/sth/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.1-java/lib/logstash/pipeline.rb:136:in `run'", "/soft/sth/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.1-java/lib/logstash/agent.rb:465:in `start_pipeline'"], :level=>:error}
{:timestamp=>"2016-05-05T09:11:48.735000+0200", :message=>"stopping pipeline", :id=>"main"}

I know that from Logstash 2.x this options are deprecated, however I have seen that with logstash-output-elasticsearch_java I can use them.

Any ideas?

Thanks in advance,


Providing your config would be helpful :slight_smile:

It is a simple configuration:

input {
  file {
    path => "/var/log/messages"

output {
   stdout { codec => rubydebug }
   elasticsearch {
   hosts => ""
   protocol => "http"
   cluster => "test"

Per the docs - - protocol is not a valid setting.

1 Like

But with logstash-output-elasticsearch_java we can use "protocol" no?

Yes, but you are not using that plugin.

I have installed it with the command (in Logstash 2.3.1 normal):

bin/logstash-plugin install logstash-output-elasticsearch_java-2.1.3.gem

Moreover, I have downloaded Logstash 2.3.1 All Plugins, in this version if you see Gemfile, you will see:

gem "logstash-output-elasticsearch_java"

In both cases it doesn't works.

I would recommend sticking with the default HTTP protocol. There is a reason support for transport and node mode was moved into a separate plugin. What is it you want to achieve that the HTTP based plugin can not do?

If you still want to use it, you will need to provide some additional details. What does your configuration with elasticsearch_java plugin look like? What is it that does not work?

I am doing several tests with the options protocol, cluster and node_name. Now, it works, I made a mistake in a part of my logstash's configuration.

Thanks for all.