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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0ac3735fa0acf3c04b6cda2e0c96d5b9afe712b
4
- data.tar.gz: f1574b4a9a353b87532ff9e03bf8096ca1bc2e02
3
+ metadata.gz: 8be1ecda7fd858c4182838210954c67eb47ffe08
4
+ data.tar.gz: 7c43ac2e6f1f463a28e115eec18fdd4abaa7807c
5
5
  SHA512:
6
- metadata.gz: 115cef6a7adf31bd408914e859c6c75421e8cd1c44d8602b67b5e605014e6cbc88fba6ae9914a724fdff28b23c7ca063ba4e0e00ab0d812d07cb4ef8e5213e42
7
- data.tar.gz: 008a59fb92a26b4fe30f5aa38ee1803bdd667e1c455e1999fe5036c1b58c13abcc19dc224023e1e33f7a829f53bcb6018c88c272f7ee84fe6439d1e47fc46a31
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
- config_name "https"
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
- public
15
- def register
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("logstash_client")
20
+ @agent = Net::HTTP::Persistent.new(@connection_name)
20
21
  @agent.reuse_ssl_sessions = true
21
- @agent.ca_file = @ca_cert_file
22
+ @agent.ca_file = @ca_cert_file
22
23
  @agent.verify_mode = OpenSSL::SSL::VERIFY_PEER
23
- end
24
+ end
24
25
 
25
- public
26
- def receive(event)
27
- return unless output?(event)
26
+ public
27
+ def receive(event)
28
+ return unless output?(event)
28
29
 
29
30
  begin
30
- case @verb
31
- when "put"
32
- request = Net::HTTP::Put.new(event.sprintf(@uri.request_uri))
33
- when "post"
34
- request = Net::HTTP::Post.new(event.sprintf(@uri.request_uri))
35
- else
36
- @logger.error("Unknown verb: ", :verb => @verb)
37
- end
38
-
39
- if @headers
40
- @headers.each do |k,v|
41
- request[k] = event.sprintf(v)
42
- end
43
- end
44
-
45
- request["Content-Type"] = "application/json"
46
- request.body = event.to_json_with_metadata
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
- end # def encode
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.7'
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.7
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-05-26 00:00:00.000000000 Z
11
+ date: 2015-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core