logstash-output-logmatic 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/logstash/outputs/logmatic.rb +6 -4
- data/logstash-output-logmatic.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f4c336a1aa8c1c96d35e9dfb0527bb3be5bbb1a
|
4
|
+
data.tar.gz: 6c7963ab72043cda85de06d3ea34d8b2fa22b44d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 388b0d88dfd686fc2c1f98887f863e31cb5e52831f5c45962f8e3db043abbd38ee660da1e0f963392a659336f203fea39defb62a88ab8cbb0098d6313b8c56e9
|
7
|
+
data.tar.gz: b0168749fd2c202341e3c313da94da9e73420c4e55bef81a3d6d7375dc1ea64c603d39d6b9b09eab575fc69cdaaacfd253b8984ffc6b9fa5fa36c518ded7aa83
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ require "logstash/namespace"
|
|
4
4
|
require "stud/buffer"
|
5
5
|
|
6
6
|
# Ship log from logstash straight to Logmatic
|
7
|
-
#
|
7
|
+
#
|
8
8
|
# To use this you will need a valid Logmatic API Key
|
9
9
|
class LogStash::Outputs::LogmaticBatch < LogStash::Outputs::Base
|
10
10
|
include Stud::Buffer
|
@@ -12,6 +12,8 @@ class LogStash::Outputs::LogmaticBatch < LogStash::Outputs::Base
|
|
12
12
|
config_name "logmatic"
|
13
13
|
milestone 2
|
14
14
|
|
15
|
+
default :codec, "json"
|
16
|
+
|
15
17
|
# The Logmatic api key
|
16
18
|
# You can find it in the 'Account' section in the Logmatic interface.
|
17
19
|
config :key, :validate => :string, :required => true
|
@@ -44,14 +46,14 @@ class LogStash::Outputs::LogmaticBatch < LogStash::Outputs::Base
|
|
44
46
|
public
|
45
47
|
def receive(event)
|
46
48
|
return unless output?(event)
|
47
|
-
buffer_receive(event)
|
49
|
+
buffer_receive(event.to_json)
|
48
50
|
end
|
49
51
|
|
50
52
|
public
|
51
53
|
def flush(events, final=false)
|
52
54
|
# Send the event over http.
|
53
55
|
request = Net::HTTP::Post.new(@uri.path)
|
54
|
-
request.body = events.
|
56
|
+
request.body = events.inspect
|
55
57
|
request.add_field("Content-Type", 'application/json')
|
56
58
|
response = @client.request(request)
|
57
59
|
if response.is_a?(Net::HTTPSuccess)
|
@@ -60,4 +62,4 @@ class LogStash::Outputs::LogmaticBatch < LogStash::Outputs::Base
|
|
60
62
|
@logger.warn("HTTP error", :error => response.error!)
|
61
63
|
end
|
62
64
|
end # def receive
|
63
|
-
end # class LogStash::Outputs::LogmaticBatch
|
65
|
+
end # class LogStash::Outputs::LogmaticBatch
|