logstash-output-websocket_topics 2.1.9 → 2.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 338fd64ac8c5da5276c2f72482df84fad68e214a
4
- data.tar.gz: cb2898519383759bab5e2577ae509f2e754128f5
3
+ metadata.gz: 9f3e272a1f160410cceba0a55c51746cd01f61ba
4
+ data.tar.gz: eae59914f27334e123e3585ae15780a859cc3c91
5
5
  SHA512:
6
- metadata.gz: c5bb6394e9e53dfc8f751b32dab8e0fa61a976e4485e1390d2ab8c5d1056cecdbef1104bf9af4b7aa60c8a475818059fbbd3e632d420103bda3b864ccfb4200f
7
- data.tar.gz: 87274dd58434fe740fb53edbbcef0451237114c26a163b02a0977a37de4559d5824921c6467fca87ee358fc8bcbffe0842d447a19d76d1c8af9b315feb37ec47
6
+ metadata.gz: daae8852cd32d24aff4c58811ab9462d4e6babc38f717ec238ac0b08419ea34450b931c3e0ce766e8318e11609fd8025cdebb94595cb6ee762347c9aa6d6543a
7
+ data.tar.gz: 54b0eb5e51fc8f3be45757557307586a2a1378757139986eec694ac05db3c98287df7abcb219bc22483a850aa5b705f39b05f3fefbaf1f9721e42c79c200dc43
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ require "json"
2
3
  require "logstash/namespace"
3
4
  require "logstash/outputs/websocket_topics"
4
5
  require "sinatra/base"
@@ -19,12 +20,12 @@ class LogStash::Outputs::WebSocket::App < Sinatra::Base
19
20
  @logger.debug("New websocket client")
20
21
  stream(:keep_open) do |out|
21
22
  ws.each do |payload|
22
- json = payload.to_json
23
- if json.type == 'subscribe-topic'
24
- @channels[json.topic].subscribe do |event|
23
+ json = JSON.parse(payload)
24
+ if json['type'] == 'subscribe-topic'
25
+ @channels[json['topic']].subscribe do |event|
25
26
  ws.publish(event)
26
27
  end
27
- elsif json.type == 'subscribe-all'
28
+ elsif json['type'] == 'subscribe-all'
28
29
  @channels.values.each do |channel|
29
30
  channel.subscribe do |event|
30
31
  ws.publish(event)
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-websocket_topics'
4
- s.version = '2.1.9'
4
+ s.version = '2.1.10'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "This output runs a websocket server and publishes any messages to those conencted clients that have subscribed to the topic being published."
7
7
  s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-websocket_topics
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.9
4
+ version: 2.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Osheroff