具有弹性搜索的变量索引名称的logstash配置

时间:2016-09-07 07:46:27

标签: logstash logstash-configuration

我有一个logstash配置,它从redis获取数据并将数据输出到elasticsearch。这就是我的配置文件:

configtest

我的弹性搜索实例由nginx在端口9200上代理,实际上它在不同的端口上运行。此外, auth是使用nginx设置的,而不是盾牌。问题是,当我在此配置上运行Configuration OK时,它会显示Pipeline aborted due to error {:exception=>"LogStash::ConfigurationError", :backtrace=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core- 2.4.0-java/lib/logstash/config/mixin.rb:88:in `config_init'", "org/jruby/RubyHash.java:1342:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0- java/lib/logstash/config/mixin.rb:72:in `config_init'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0- java/lib/logstash/outputs/base.rb:79:in `initialize'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0- java/lib/logstash/output_delegator.rb:74:in `register'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0- java/lib/logstash/pipeline.rb:181:in `start_workers'", "org/jruby/RubyArray.java:1613:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0- java/lib/logstash/pipeline.rb:181:in `start_workers'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0- java/lib/logstash/pipeline.rb:136:in `run'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0- java/lib/logstash/agent.rb:491:in `start_pipeline'"], :level=>:error} 。但是,当我运行此脚本时,会抛出此错误:

host => "http://user:password@host:9200"

为什么会抛出此错误?我在这里做错了什么?

修改

请注意,我也尝试过使用

..., A, B, ...

但这也不起作用。

1 个答案:

答案 0 :(得分:1)

如果您使用的是Logstash版本2+,则它不是host,而是hosts

Cf documentation

  

主机
  值类型是数组
  默认值为[" 127.0.0.1"]
  设置远程实例的主机。