logstash-lite 0.2.20110329105411 → 0.2.20110331121236
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/logstash/outputs/gelf.rb +10 -9
- 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 =
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
-
|
30
|
+
m["#{name}"] = value
|
30
31
|
end
|
31
|
-
|
32
|
-
gelf.
|
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:
|
4
|
+
hash: 40220662242495
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
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-
|
19
|
+
date: 2011-03-31 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|