Class: LogStash::Outputs::Tcp
- Inherits:
-
Base
- Object
- Base
- LogStash::Outputs::Tcp
show all
- Defined in:
- lib/logstash/outputs/tcp.rb
Instance Attribute Summary
Attributes inherited from Base
#logger
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#receive(event) ⇒ Object
18
19
20
21
|
# File 'lib/logstash/outputs/tcp.rb', line 18
def receive(event)
@connection.send_data(event.to_hash.to_json)
@connection.send_data("\n")
end
|
#register ⇒ Object
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/logstash/outputs/tcp.rb', line 6
def register
if !@url.host or !@url.port
@logger.fatal("No host or port given in #{self.class}: #{@url}")
raise "configuration error"
end
@connection = EventMachine::connect(@url.host, @url.port)
end
|