logstash-output-qingstor 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff8942eb9e9d52efdd58c06bfdeb77abc8698d2c
4
- data.tar.gz: 34704f434b5c411eb7ab5bd3cbf4a553b9e41176
3
+ metadata.gz: 37cd55d01157b2c5608f05cdbcb180bf4481f211
4
+ data.tar.gz: b2a6a86bde35c314a081d2fbe5c2e7659441727c
5
5
  SHA512:
6
- metadata.gz: 80a48c0492352fe8d1b486eccb9e4dc3848bb3aafefc8cc0229a0db3ffb63f7346cce08e8dc4efad7fcfa09f9c3a78681f2d0b81d8e705afc8d1f902068ede28
7
- data.tar.gz: cc45d155ba152691d7972e4895f838ea4f3486fccf59bea0dd60480bbb1c6d154b2d5d3a84b356a741c1632d8fb02553c338fa7dd5e38c5966cf2888a7508b3e
6
+ metadata.gz: 808e7a27ec343e15a36733cfa59c77377f19e1948f126b5299f492fdcdc0715cba6d7050529868d5d8349c2a7991a73e95a9f4826107c50c8fa43857de02d5a6
7
+ data.tar.gz: 3b7c31af1054c5c267d9e1eb4a555eb342e84d0cc3eb6cc42265a6c17f71167dc63522e5e69a9cebac0d1f9e2fd85a884aacee678ba2c9336804c641b4dd79ab
@@ -41,6 +41,12 @@ class LogStash::Outputs::Qingstor < LogStash::Outputs::Base
41
41
  # The key to access your QingStor
42
42
  config :secret_access_key, :validate => :string, :required => true
43
43
 
44
+ # If specified, it would redirect to this host address.
45
+ config :host, :validate => :string, :default => nil
46
+
47
+ # It specifies the host port, please coordinate with config 'host'.
48
+ config :port, :validate => :number, :default => 443
49
+
44
50
  # The name of the qingstor bucket
45
51
  config :bucket, :validate => :string, :required => true
46
52
 
@@ -65,10 +71,10 @@ class LogStash::Outputs::Qingstor < LogStash::Outputs::Base
65
71
  config :rotation_strategy, :validate => ["size_and_time", "size", "time"], :default => "size_and_time"
66
72
 
67
73
  # Define the size requirement for each file to upload to qingstor. In byte.
68
- config :size_file, :validate => :number, :default => 1024 * 1024 * 5
74
+ config :file_size, :validate => :number, :default => 1024 * 1024 * 5
69
75
 
70
76
  # Define the time interval for each file to upload to qingstor. In minutes.
71
- config :time_file, :validate => :number, :default => 15
77
+ config :file_time, :validate => :number, :default => 15
72
78
 
73
79
  # Specify maximum number of workers to use to upload the files to Qingstor
74
80
  config :upload_workers_count, :validate => :number, :default => (Concurrent.processor_count * 0.5).ceil
@@ -138,11 +144,11 @@ class LogStash::Outputs::Qingstor < LogStash::Outputs::Base
138
144
  def rotation_strategy
139
145
  case @rotation_strategy
140
146
  when "size"
141
- SizeRotationPolicy.new(@size_file)
147
+ SizeRotationPolicy.new(@file_size)
142
148
  when "time"
143
- TimeRotationPolicy.new(@time_file)
149
+ TimeRotationPolicy.new(@file_time)
144
150
  when "size_and_time"
145
- SizeAndTimeRotationPolicy.new(@size_file, @time_file)
151
+ SizeAndTimeRotationPolicy.new(@file_size, @file_time)
146
152
  end
147
153
  end
148
154
 
@@ -173,6 +179,7 @@ class LogStash::Outputs::Qingstor < LogStash::Outputs::Base
173
179
 
174
180
  def get_bucket
175
181
  @qs_config = QingStor::SDK::Config.init @access_key_id, @secret_access_key
182
+ @qs_config.update({ host: @host, port: @port }) unless @host.nil?
176
183
  @qs_service = QingStor::SDK::Service.new @qs_config
177
184
  @qs_service.bucket @bucket, @region
178
185
  end
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-qingstor'
3
- s.version = '0.1.0'
3
+ s.version = '0.1.1'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = 'logstash output plugin for qingstor'
6
- s.description = 'Put the outcomes of logstash into qingstor'
6
+ s.description = 'Collect the outcomes of logstash into Qingstor'
7
7
  s.homepage = 'https://github.com/tacinight/logstash-output-qingstor'
8
8
  s.authors = ['Evan Zhao']
9
9
  s.email = 'tacingiht@gmail.com'
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  # Gem dependencies
21
21
  s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"
22
22
  s.add_runtime_dependency "logstash-codec-plain"
23
- s.add_runtime_dependency "qingstor-sdk", "=1.9.2"
23
+ s.add_runtime_dependency "qingstor-sdk", ">=1.9.2"
24
24
  s.add_runtime_dependency "concurrent-ruby"
25
25
 
26
26
  s.add_development_dependency "stud", "~> 0.0.22"
@@ -47,4 +47,14 @@ describe LogStash::Outputs::Qingstor do
47
47
  expect(list_remote_file.size).to eq(2)
48
48
  end
49
49
 
50
+ it "redirect to the specified host without specified port" do
51
+ new_options = options.merge({"host" => "qingstor.dev", "port" => 444})
52
+ expect{fetch_event(new_options, events_and_encoded)}.to raise_error(Net::HTTP::Persistent::Error)
53
+ end
54
+
55
+ it "redirect to the specified host without specified port" do
56
+ new_options = options.merge({"host" => "qingstor.dev", "port" => 444})
57
+ expect{fetch_event(new_options, events_and_encoded)}.to raise_error(Net::HTTP::Persistent::Error)
58
+ end
59
+
50
60
  end
@@ -1,4 +1,4 @@
1
1
  require "logstash/devutils/rspec/spec_helper"
2
2
  require "logstash/logging/logger"
3
3
 
4
- LogStash::Logging::Logger::configure_logging("debug")
4
+ LogStash::Logging::Logger::configure_logging("warn")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-qingstor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Zhao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-09 00:00:00.000000000 Z
11
+ date: 2017-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -41,7 +41,7 @@ dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - '='
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: 1.9.2
47
47
  name: qingstor-sdk
@@ -49,7 +49,7 @@ dependencies:
49
49
  type: :runtime
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.9.2
55
55
  - !ruby/object:Gem::Dependency
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- description: Put the outcomes of logstash into qingstor
97
+ description: Collect the outcomes of logstash into Qingstor
98
98
  email: tacingiht@gmail.com
99
99
  executables: []
100
100
  extensions: []