logstash-output-https 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/outputs/https.rb +28 -27
- data/logstash-output-https.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8be1ecda7fd858c4182838210954c67eb47ffe08
|
4
|
+
data.tar.gz: 7c43ac2e6f1f463a28e115eec18fdd4abaa7807c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53ac4e90f4e1e62362d41031d5c30cabfd7655091dcd4016dd84649b90bdbb0d86afcb14d29757ebc6a6bed32b69e4659b40604452a698d0672ab1e9f810db89
|
7
|
+
data.tar.gz: da9551ac6a4c357a9cc492db06541da8f7652647fee29980854614b40abb20856499603ce985e9fff11982fc1321ea44736d2fe4ba284f5c0a8cfc2121697611
|
@@ -4,46 +4,47 @@ require "logstash/namespace"
|
|
4
4
|
require "logstash/json"
|
5
5
|
|
6
6
|
class LogStash::Outputs::Https < LogStash::Outputs::Base
|
7
|
-
|
7
|
+
config_name "https"
|
8
8
|
|
9
9
|
config :url, :validate => :string, :required => :true
|
10
10
|
config :ca_cert_file, :validate => :path, :required => :true
|
11
|
+
config :connection_name, :validate => :string, :default => "logstash_client"
|
11
12
|
config :headers, :validate => :hash
|
12
13
|
config :verb, :validate => ["put", "post"], :default => "post"
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
public
|
16
|
+
def register
|
16
17
|
require "net/http/persistent"
|
17
18
|
|
18
19
|
@uri = URI.parse(@url)
|
19
|
-
@agent = Net::HTTP::Persistent.new(
|
20
|
+
@agent = Net::HTTP::Persistent.new(@connection_name)
|
20
21
|
@agent.reuse_ssl_sessions = true
|
21
|
-
|
22
|
+
@agent.ca_file = @ca_cert_file
|
22
23
|
@agent.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
23
|
-
|
24
|
+
end
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
26
|
+
public
|
27
|
+
def receive(event)
|
28
|
+
return unless output?(event)
|
28
29
|
|
29
30
|
begin
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
31
|
+
case @verb
|
32
|
+
when "put"
|
33
|
+
request = Net::HTTP::Put.new(event.sprintf(@uri.request_uri))
|
34
|
+
when "post"
|
35
|
+
request = Net::HTTP::Post.new(event.sprintf(@uri.request_uri))
|
36
|
+
else
|
37
|
+
@logger.error("Unknown verb: ", :verb => @verb)
|
38
|
+
end
|
39
|
+
|
40
|
+
if @headers
|
41
|
+
@headers.each do |k,v|
|
42
|
+
request[k] = event.sprintf(v)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
request["Content-Type"] = "application/json"
|
47
|
+
request.body = event.to_json_with_metadata
|
47
48
|
|
48
49
|
response = @agent.request(@uri, request)
|
49
50
|
#puts response.code
|
@@ -51,6 +52,6 @@ class LogStash::Outputs::Https < LogStash::Outputs::Base
|
|
51
52
|
rescue Exception => e
|
52
53
|
@logger.warn("Unhandled exception: ", :request => request, :response => response, :exception => e, :stacktrace => e.backtrace)
|
53
54
|
end
|
54
|
-
|
55
|
+
end # def encode
|
55
56
|
|
56
57
|
end # class LogStash::Outputs::Https
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-output-https'
|
4
|
-
s.version = '0.0.
|
4
|
+
s.version = '0.0.8'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Simple HTTPS Output."
|
7
7
|
s.description = "This gem is a logstash plugin to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program."
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-https
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emdeon Enterprise Monitoring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-core
|