简体   繁体   English

Logstash无法将输出发送到弹性搜索

[英]Logstash unable to send output to elastic search

This question has already been asked here https://stackoverflow.com/questions/30283837/logstash-unable-to-send-output-to-elasticsearch but I can't see the actual answer. 这个问题已经在这里被问到了https://stackoverflow.com/questions/30283837/logstash-unable-to-send-output-to-elasticsearch,但是我看不到实际的答案。 Can someone advise if there is a solution to this please as I am suffering the same problem. 有人可以建议我是否有解决方案,因为我遇到了同样的问题。

I believe this is a system parameter causing the problem as I've run the same config on a different machine and it works fine. 我相信这是一个引起问题的系统参数,因为我已经在另一台计算机上运行了相同的配置,并且运行良好。 Anyone know what this might be? 有人知道这可能是什么吗?

I've looked everywhere to find an answer but can only find a firewall issue (so tried outside the firewall) and the time stamp being different between the twitter server and my machine (machine timing set correctly). 我到处都在寻找答案,但是只能找到防火墙问题(因此在防火墙之外尝试过),并且Twitter服务器和我的机器之间的时间戳不同(机器时间设置正确)。 Can anyone advise what's causing the below authorisation error (I've also checked the twitter app and settings are correct and working). 任何人都可以告知导致以下授权错误的原因(我还检查了Twitter应用程序和设置是否正确并且可以正常工作)。

Logstash startup completed
←[33m {:exception=>Twitter::Error::Unauthorized, :backtrace=>["C:/logstash-1.5.1
/vendor/bundle/jruby/1.9/gems/twitter-5.12.0/lib/twitter/streaming/response.rb:2
1:in on_headers_complete'", "org/ruby_http_parser/RubyHttpParser.java:370:in<
<'", "C:/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/twitter-5.12.0/lib/twitter/
streaming/response.rb:16:in <<'", "C:/logstash-1.5.1/vendor/bundle/jruby/1.9/ge
ms/twitter-5.12.0/lib/twitter/streaming/connection.rb:22:instream'", "C:/logst
ash-1.5.1/vendor/bundle/jruby/1.9/gems/twitter-5.12.0/lib/twitter/streaming/clie
nt.rb:116:in request'", "C:/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/twitter
-5.12.0/lib/twitter/streaming/client.rb:36:infilter'", "C:/logstash-1.5.1/vend
or/bundle/jruby/1.9/gems/logstash-input-twitter-0.1.6/lib/logstash/inputs/twitte
r.rb:88:in run'", "C:/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-core
-1.5.1-java/lib/logstash/pipeline.rb:176:ininputworker'", "C:/logstash-1.5.1/v
endor/bundle/jruby/1.9/gems/logstash-core-1.5.1-java/lib/logstash/pipeline.rb:17
0:in `start_input'"], :level=>:warn}←[0m

I'm using the below twitter config:- 我正在使用以下Twitter配置:-

input {
twitter {
consumer_key => "xxxxxxxxxxxxxxxxxx"
consumer_secret => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
oauth_token => "xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
oauth_token_secret => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
keywords => ["xxxxxxxxxxx"]
full_tweet => true
}
}

output {
stdout { codec => dots }
elasticsearch {
protocol => "http"
host => "localhost"
index => "twitter"
document_type => "tweet"
template => "twitter_template.json"
template_name => "twitter"
}
}

I tried the same from outside the firewall and instead of authorisation issue I get a connection refused. 我从防火墙外部尝试了同样的方法,而不是授权问题,我拒绝了连接。 So I believe warkolm you were correct but that's just left me with a different problem. 所以我相信warkolm您是正确的,但这给我带来了另一个问题。

←[33mConnection refused - Connection refused {:exception=># Connection refused - Connection refused>, :backtrace=>["org/jruby/ext/socket/Ru
byTCPSocket.java:126:in initialize'", "org/jruby/RubyIO.java:853:innew'", "C:
/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/twitter-5.12.0/lib/twitter/streamin
g/connection.rb:16:in stream'", "C:/logstash-1.5.1/vendor/bundle/jruby/1.9/gems
/twitter-5.12.0/lib/twitter/streaming/client.rb:116:inrequest'", "C:/logstash-
1.5.1/vendor/bundle/jruby/1.9/gems/twitter-5.12.0/lib/twitter/streaming/client.r
b:36:in filter'", "C:/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-inpu
t-twitter-0.1.6/lib/logstash/inputs/twitter.rb:88:inrun'", "C:/logstash-1.5.1/
vendor/bundle/jruby/1.9/gems/logstash-core-1.5.1-java/lib/logstash/pipeline.rb:1
76:in inputworker'", "C:/logstash-1.5.1/vendor/bundle/jruby/1.9/gems/logstash-c
ore-1.5.1-java/lib/logstash/pipeline.rb:170:instart_input'"], :level=>:warn}←[
0m

This is even after trying a new set of twitter authorization codes. 甚至在尝试了一组新的Twitter授权代码后也是如此。

If this same configuration is run on another developers machine it works fine so there is a config on my desktop that isn't set correctly (both machines are running the same setup windows 8.1 running ES 1.7.1 and LS 1.5.1). 如果在另一位开发人员的计算机上运行相同的配置,则它可以正常工作,因此我的桌面上存在未正确设置的配置(两台计算机都运行运行ES 1.7.1和LS 1.5.1的相同安装Windows 8.1)。

Any thoughts on what setting is missing on my machine. 对我的机器上缺少什么设置的任何想法。

Thanks Leigh 谢谢雷

The stack trace that you provided originates in the Twitter connection phase -- its's getting connect refused when trying to initiate a connection to stream.twitter.com:443. 您提供的堆栈跟踪起源于Twitter连接阶段-尝试启动与stream.twitter.com:443的连接时,它的连接被拒绝。 Since that's unlikely that the streaming api for twitter was down, you've probably got a firewall blocking you in some way. 由于不太可能出现Twitter的流式API崩溃的情况,因此您可能已经有防火墙以某种方式阻止了您。

Looking up stream.twitter.com, there are multiple A records for it... So it's possible that whomever runs your firewall missed an address or something like that. 查找stream.twitter.com,有多个A记录...因此,运行防火墙的任何人都有可能丢失地址或类似内容。 It could be that the other developer has a host file entry to force it to a specific address. 可能是其他开发人员有一个主机文件条目,以将其强制到特定地址。

If you look at something like this it will show you what addresses a given host is associated with. 如果您看到这样的内容 ,它将显示给定主机与哪些地址相关联。

You can then try telneting to port 443 on each address to see if you get a connection or a connection refused on each one. 然后,您可以尝试在每个地址上远程登录到端口443,以查看是否在每个地址上获得连接或连接被拒绝。

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

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