Class: LogStash::Outputs::PubnubCustom
- Inherits:
-
Base
- Object
- Base
- LogStash::Outputs::PubnubCustom
- Defined in:
- lib/logstash/outputs/pubnub_custom.rb
Overview
An logstash-output-pubnub output that does nothing.
Instance Method Summary collapse
Instance Method Details
#receive(event) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/logstash/outputs/pubnub_custom.rb', line 22 def receive(event) document = {}.merge(event.to_hash) keys = @channel_keys.to_s.split(",") = JSON.parse(document['message']) channel = [keys[0]]+ ":"+ [keys[1]]+ ":"+ [keys[2]] puts channel @pubnub.publish(http_sync: true, message: document , channel: channel.to_s) end |
#register ⇒ Object
17 18 19 |
# File 'lib/logstash/outputs/pubnub_custom.rb', line 17 def register @pubnub = Pubnub.new( publish_key: @pubnub_publish_key, subscribe_key: @pubnub_subscribe_key, logger: Logger.new(STDOUT) ) end |