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
34
|
# File 'lib/logstash/outputs/gelf.rb', line 18
def receive(event)
gelf = GELF::Notifier.new(@url.host, (@url.port or 12201))
m = Hash.new
m["short_message"] = (event.fields["message"] or event.message)
m["full_message"] = (event.message)
m["host"] = event["@source_host"]
m["file"] = event["@source_path"]
m["level"] = 1
event.fields.each do |name, value|
next if value == nil or value.empty?
m["#{name}"] = value
end
m["timestamp"] = event.timestamp
gelf.notify(m)
end
|
#register ⇒ Object
13
14
15
|
# File 'lib/logstash/outputs/gelf.rb', line 13
def register
end
|