Open Guisardo opened 8 years ago
So, I'd found this elasticsearch plugin that does de websocket magic: https://github.com/jurgc11/es-change-feed-plugin
Still, it would be nice to fix the logstash plugin :)
I believe this is a bug in output_delegator.rb
First there is a registering of all additional (if more than one) output workers:
@workers += (@worker_count - 1).times.map do
inst = @klass.new(*args)
inst.register
inst
end
Then there is another registering of each worker:
def register
@workers.each {|w| w.register}
end
So I altered the latter to do nothing and it worked for me:
def register
@logger.info("Worker should already be registered, skipping")
end
In addition to that the websocket is not threadsafe so there can be only one worker, regardless of how many you tell it to spawn. To ensure this works after logstash 2.2+ you have to make sure it has the following code in the class definition:
if self.respond_to?(:workers_not_supported!) # Check for v2.2+ API
declare_workers_not_supported!("Websocket only supports one w orker to prevent text overlap!")
end
Hi @Ulrhol, it appears that the PR you filed failed in test because you have not signed the Contributor Licensing Agreement. Would you mind signing that so the code can be incorporated? Thanks!
After restarting logstash, I'm getting the websocket already in use message too. I'm running version 2.2.4 of logstash.
{:timestamp=>"2016-06-27T15:16:35.034000-0400", :message=>"websocket server failed", :exception=>#<Errno::EADDRINUSE: Address already in use - bind - Address already in use>, :level=>:error}
Hi there, I cannot make the websocket output work. I need an input http, and a piped output that saves the events in elastic and also publish them in a websocket. So I had made this configuration:
But, even though I can connect to the websocket, nothing is been published. In the logs I keep seeing this error:
{:timestamp=>"2016-02-08T21:11:15.269000+0000", :message=>"websocket server failed", :exception=>#<Errno::EADDRINUSE: Address already in use - bind - Address already in use>, :level=>:error, :file=>"logstash/outputs/websocket.rb", :line=>"33", :method=>"register"}
Any ideas? I had already tried replacing the http input with the stdin, but same results. Removing the elasticsearch output didn't help ether... here are the full logs:
Let me know if you need more info. Best.