Class: LogStash::Outputs::Gelf
- Inherits:
-
Base
- Object
- Base
- LogStash::Outputs::Gelf
show all
- Defined in:
- lib/logstash/outputs/gelf.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
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/logstash/outputs/gelf.rb', line 18
def receive(event)
gelf = Gelf.new(@url.host, (@url.port or 12201))
gelf.short_message = (event.fields["message"] or event.message)
gelf.full_message = (event.message)
gelf.level = 1
gelf.host = event["@source_host"]
gelf.file = event["@source_path"]
event.fields.each do |name, value|
next if value == nil or value.empty?
gelf.add_additional name, value
end
gelf.add_additional "event_timestamp", event.timestamp
gelf.send
end
|
#register ⇒ Object
13
14
15
|
# File 'lib/logstash/outputs/gelf.rb', line 13
def register
end
|