简体   繁体   English

从 Logstash 更新到 Elastic Search 失败

[英]Update from Logstash to Elastic Search failed

I want to parse a simple logfile with logstash and post the results to elastic search.我想用 logstash 解析一个简单的日志文件并将结果发布到弹性搜索。 I've configured logstash according to the log stash documentation .我已经根据log stash 文档配置了 logstash。

But Logstash reports this error:但是Logstash报这个错误:

Attempted to send a bulk request to Elasticsearch configured at '["http://localhost:9200/"]',
but Elasticsearch appears to be unreachable or down!
{:client_config=>{:hosts=>["http://localhost:9200/"], :ssl=>nil,
:transport_options=>{:socket_timeout=>0, :request_timeout=>0, :proxy=>nil,
:ssl=>{}}, :transport_class=>Elasticsearch::Transport::Transport::HTTP::Manticore,
:logger=>nil, :tracer=>nil, :reload_connections=>false, :retry_on_failure=>false,
:reload_on_failure=>false, :randomize_hosts=>false}, :error_message=>"Connection refused",
:level=>:error}

My configuration looks like this:我的配置是这样的:

input { stdin{} }

filter {
    grok {
        match => { "message" => "%{NOTSPACE:demo}"}
    }
}

output {
  elasticsearch { hosts => "localhost:9200"}
}

Of course elastic search is available when calling http://localhost:9200/调用http://localhost:9200/时当然可以使用elasticsearch

Versions: logstash-2.0.0, elasticsearch-2.0.0 OSX版本:logstash-2.0.0、elasticsearch-2.0.0 OSX

I've found a thread with a similar issue.我找到了一个有类似问题的线程 But this seems to be a bug in an older logstash version.但这似乎是较旧的 logstash 版本中的错误。

I changed localhost to 127.0.0.1我将本地主机更改为 127.0.0.1

This works:这有效:

output {
  elasticsearch { hosts => "127.0.0.1:9200"}
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM