ELK学习13_logstash启动报错[logstash.outputs.elasticsearch] Unknown setting 'host' for elasticsearch

24 篇文章 0 订阅
15 篇文章 0 订阅

启动elasticsearch后:

[admin@ELK config]$ netstat -tnlp|grep java
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp6       0      0 127.0.0.1:9200          :::*                    LISTEN      22138/java          
tcp6       0      0 127.0.0.1:9300          :::*                    LISTEN      22138/java    
 
 
  • 1
  • 2
  • 3
  • 4
  • 5

再启动logstash出现报错

[root@ELK config]# logstash -f logstash-elasticsearch.conf 
OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
Sending Logstash's logs to /usr/local/logstash-5.4.0/logs which is now configured via log4j2.properties
[2017-05-25T08:05:03,717][ERROR][logstash.outputs.elasticsearch] Unknown setting 'host' for elasticsearch
[2017-05-25T08:05:03,767][ERROR][logstash.agent           ] Cannot create pipeline {:reason=>"Something is wrong with your configuration."}

 
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

其中logstash-elasticsearch.conf的配置如下:

input { stdin {} }
output {
        elasticsearch {
                host => '127.0.0.1'
        }
        stdout { codec => rubydebug }
}

 
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

解决方法: 
将配置里面的host改为hosts,好像是因为文档的一个bug。 
修改过后连接成功:

[2017-05-25T08:16:32,965][INFO ][logstash.pipeline        ] Pipeline main started
The stdin plugin is now waiting for input:
[2017-05-25T08:16:33,156][INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600}
{
    "@timestamp" => 2017-05-25T12:16:32.992Z,
      "@version" => "1",
          "host" => "ELK",
       "message" => "test"
}
 
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

In the elasticsearch input, it’s hosts no matter which version. However, in the elasticsearch output, it was host before Logstash 2.0 and then the property name has been standardized to hosts. – Val Mar 10 ‘16 at 13:22 
参考自:https://stackoverflow.com/questions/32200868/logstash-input-from-elasticsearch-error

原文来自:http://blog.csdn.net/u010521366/article/details/72747458?utm_source=itdadao&utm_medium=referral


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值