fluent-plugin-azureeventhubs 0.0.2 → 0.0.3

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: 0bb3ea484dd72900d92738afc4a4949712320738
4
- data.tar.gz: 32eaffcadc56261be9b6dd60c9816062001fca41
3
+ metadata.gz: 1e3a54871973cb83319bea0a414a183e3108c7e7
4
+ data.tar.gz: 8844910f004dd600afa6aab33a1f7c1e3de89ce3
5
5
  SHA512:
6
- metadata.gz: 5c2f7b9e06854f9be971022132849b2e8050e3959cf357e112549da885d537ccc4d2d11939aecebc34ebf5d0115f7b6e3d4bf138df0259c654c24f2aaac67c9a
7
- data.tar.gz: e375ec9e310ef8e301c3ac66d982fe43940a4721e7d93779d86ac1954163556a76b73f154d5b83f77c210fa9f4239495fd4a50cd2e17185cfcf6ef5192c1b484
6
+ metadata.gz: 23236af56257c72f7bde1af3ca90333648fd65a9b29f3455a609d7f5759a564c22b3ba396b93f8111d6474a08c91a3e95d5ae6371936cf041f7827ccc7418b90
7
+ data.tar.gz: b98b702169f028d1d49cc6d2c5c5acc3e881b381bcb8bae95707dcd35feddf8d64008bb92954e2f4433ad952f169faddb8b60fd7f1b11ab0b88a387bd94e2676
data/README.md CHANGED
@@ -31,6 +31,8 @@ Or install it yourself as:
31
31
  tag_time_name record_time # record tag for time when include_time sets true. [Optional: default => 'time']
32
32
  type (https|amqps) # Connection type. [Optional: default => https]. Note that amqps is not implementated.
33
33
  expiry_interval <Integer number> # Signature expiration time interval in seconds. [Optional: default => 3600 (60min)]
34
+ proxy_addr <Host or IP> # Address of the proxy [Optional]
35
+ proxy_port <Integer> # Proxy port. [Optional: default => 3128]
34
36
  </match>
35
37
  ```
36
38
 
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-azureeventhubs"
7
- spec.version = "0.0.2"
7
+ spec.version = "0.0.3"
8
8
  spec.authors = ["Hidemasa Togashi"]
9
9
  spec.email = ["togachiro@gmail.com"]
10
10
  spec.summary = "Fluentd output plugin for Azure Event Hubs"
@@ -1,6 +1,6 @@
1
1
 
2
2
  class AzureEventHubsHttpSender
3
- def initialize(connection_string, hub_name, expiry=3600)
3
+ def initialize(connection_string, hub_name, expiry=3600,proxy_addr='',proxy_port=3128)
4
4
  require 'openssl'
5
5
  require 'base64'
6
6
  require 'net/http'
@@ -10,6 +10,8 @@ class AzureEventHubsHttpSender
10
10
  @connection_string = connection_string
11
11
  @hub_name = hub_name
12
12
  @expiry_interval = expiry
13
+ @proxy_addr = proxy_addr
14
+ @proxy_port = proxy_port
13
15
 
14
16
  if @connection_string.count(';') != 2
15
17
  raise "Connection String format is not correct"
@@ -45,7 +47,11 @@ class AzureEventHubsHttpSender
45
47
  'Content-Type' => 'application/atom+xml;type=entry;charset=utf-8',
46
48
  'Authorization' => token
47
49
  }
48
- https = Net::HTTP.new(@uri.host, @uri.port)
50
+ if (@proxy_addr.to_s.empty?)
51
+ https = Net::HTTP.new(@uri.host, @uri.port)
52
+ else
53
+ https = Net::HTTP.new(@uri.host, @uri.port,@proxy_addr,@proxy_port)
54
+ end
49
55
  https.use_ssl = true
50
56
  req = Net::HTTP::Post.new(@uri.request_uri, headers)
51
57
  req.body = payload.to_json
@@ -10,6 +10,8 @@
10
10
  config_param :tag_time_name, :string, :default => 'time'
11
11
  config_param :expiry_interval, :integer, :default => 3600 # 60min
12
12
  config_param :type, :string, :default => 'https' # https / amqps (Not Implemented)
13
+ config_param :proxy_addr, :string, :default => ''
14
+ config_param :proxy_port, :integer,:default => 3128
13
15
 
14
16
  def configure(conf)
15
17
  super
@@ -18,7 +20,7 @@
18
20
  raise NotImplementedError
19
21
  else
20
22
  require_relative 'azureeventhubs/http'
21
- @sender = AzureEventHubsHttpSender.new(@connection_string, @hub_name, @expiry_interval)
23
+ @sender = AzureEventHubsHttpSender.new(@connection_string, @hub_name, @expiry_interval,@proxy_addr,@proxy_port)
22
24
  end
23
25
  end
24
26
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-azureeventhubs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hidemasa Togashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-19 00:00:00.000000000 Z
11
+ date: 2016-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  version: '0'
74
74
  requirements: []
75
75
  rubyforge_project:
76
- rubygems_version: 2.2.2
76
+ rubygems_version: 2.4.8
77
77
  signing_key:
78
78
  specification_version: 4
79
79
  summary: Fluentd output plugin for Azure Event Hubs