logstash-lite 0.2.20110329105411 → 0.2.20110331121236

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/logstash/outputs/gelf.rb +10 -9
  2. metadata +4 -4
@@ -17,18 +17,19 @@ class LogStash::Outputs::Gelf < LogStash::Outputs::Base
17
17
  public
18
18
  def receive(event)
19
19
  # TODO(sissel): Use Gelf::Message instead
20
- gelf = Gelf.new(@url.host, (@url.port or 12201))
21
- gelf.short_message = (event.fields["message"] or event.message)
22
- gelf.full_message = (event.message)
23
- gelf.level = 1
24
- gelf.host = event["@source_host"]
25
- gelf.file = event["@source_path"]
20
+ gelf = GELF::Notifier.new(@url.host, (@url.port or 12201))
21
+ m = Hash.new
22
+ m["short_message"] = (event.fields["message"] or event.message)
23
+ m["full_message"] = (event.message)
24
+ m["host"] = event["@source_host"]
25
+ m["file"] = event["@source_path"]
26
+ m["level"] = 1
26
27
 
27
28
  event.fields.each do |name, value|
28
29
  next if value == nil or value.empty?
29
- gelf.add_additional name, value
30
+ m["#{name}"] = value
30
31
  end
31
- gelf.add_additional "event_timestamp", event.timestamp
32
- gelf.send
32
+ m["timestamp"] = event.timestamp
33
+ gelf.notify(m)
33
34
  end # def receive
34
35
  end # class LogStash::Outputs::Gelf
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-lite
3
3
  version: !ruby/object:Gem::Version
4
- hash: 40220658210833
4
+ hash: 40220662242495
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 20110329105411
10
- version: 0.2.20110329105411
9
+ - 20110331121236
10
+ version: 0.2.20110331121236
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jordan Sissel
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-03-29 00:00:00 -07:00
19
+ date: 2011-03-31 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency