logstash-input-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: 4a30583b85c2e846709cecde14a016f28f1907b3
4
- data.tar.gz: 7834fd79bf3ad2c7de3e971faf42e347fe38f769
3
+ metadata.gz: 679252ef4ae7fcdd727e8f166144a8bace84a129
4
+ data.tar.gz: 0cbb0d8e979c3de16c54b4ca36a2b60421101c13
5
5
  SHA512:
6
- metadata.gz: e63c11974c60a1fa33525c5b758ebbe7d80202d0e534605060bdbc7833df608d87db40e92c4cc4775be37ae78373df264ed6d96b226feab083bee8a658ec35f5
7
- data.tar.gz: 0723a8e49fd65c445d5546030f8fc4130794cc96148ebeebd8e517b9280f00f2db732416a90eff7d8dbe3b7d499f2a9e166978bace5b2a624075cb51f4fbad0a
6
+ metadata.gz: 83373625a41b3b4096c3fadcf416ab3eeec8e31229ed2283cc1f6fe12edabb3be282cc28260369fb7e4a62406017547353e8f7cfe194d9e8d2a469dc3b1e845c
7
+ data.tar.gz: 865337483a3d9b17a699ef7cf1cf36f530fa00d82cdebdf843b74aaf5dd34916ff386a22c2b7c423349c7ba8b325aea7362f6ae9e629c9468b5c7ad6e9d98c06
data/README.md CHANGED
@@ -4,7 +4,11 @@
4
4
  作为一个input插件, 它能下载存储在Qingstor上的日志文件, 读入到logstash中进行进一步处理.
5
5
  详细功能参考下面配置说明.
6
6
 
7
- 目前代码尚未提交至官方插件库, 需要手动安装, 安装方法参考下文.
7
+ 目前插件已经提交至rubygems.org, 使用以下命令安装:
8
+ ```sh
9
+ bin/logstash-plugin install logstash-input-qingstor
10
+ ```
11
+ 手动安装本地代码, 安装方法参考下文.
8
12
 
9
13
  ## 1. 配置说明
10
14
 
@@ -37,7 +41,7 @@ input {
37
41
 
38
42
  # 是否在处理之后, 删除远程bucket中的文件.
39
43
  # 默认: false
40
- delete_later => true
44
+ delete_remote_files => true
41
45
 
42
46
  # 如果指定一个本地目录, 那么在处理完之后将文件备份至该位置.
43
47
  # 默认: nil
@@ -108,11 +112,15 @@ bin/logstash-plugin install /your/local/plugin/logstash-input-qingstor.gem
108
112
  As an input plugin, it can download the log files from [Qingstor](https://www.qingcloud.com/products/storage#qingstor), and read them into logstash.
109
113
  Qingstor is a remarkable object storage service provided by [Qingcloud](https://www.qingcloud.com/).
110
114
 
111
- For now, We haven't submitted this to official plugin repository. If you want to have a try, please refer to the following guide to install it manually.
115
+ For now, We've submitted this plugin to rubygems.org. Use the following command to install.
116
+ ```sh
117
+ bin/logstash-plugin install logstash-input-qingstor
118
+ ```
119
+ If want to install the local code, please refer to the following guide to install it manually.
112
120
 
113
121
  ## 1. Configuration Guide
114
122
 
115
- #### 1.1 Run in minimal Configuration Items
123
+ #### 1.1 Run in minimal Configuration Settings
116
124
  ```sh
117
125
  input {
118
126
  qingstor {
@@ -32,7 +32,7 @@ class LogStash::Inputs::Qingstor < LogStash::Inputs::Base
32
32
  config :tmpdir, :validate => :string, :default => File.join(Dir.tmpdir, "qingstor2logstash")
33
33
 
34
34
  # If this set to true, the remote file will be deleted after processed
35
- config :delete_later, :validate => :boolean, :default => false
35
+ config :delete_remote_files, :validate => :boolean, :default => false
36
36
 
37
37
  # If this set to true, the file will backup to a local dir,
38
38
  # please make sure you can access to this dir.
@@ -73,7 +73,7 @@ class LogStash::Inputs::Qingstor < LogStash::Inputs::Base
73
73
  @qs_bucket = @qs_service.bucket @bucket, @region
74
74
 
75
75
  QingstorValidator.bucket_valid?(@qs_bucket)
76
- QingstorValidator.prefix_valid?(@backup_prefix)
76
+ QingstorValidator.prefix_valid?(@backup_prefix) unless @backup_prefix.nil?
77
77
 
78
78
  end # def register
79
79
 
@@ -96,7 +96,7 @@ class LogStash::Inputs::Qingstor < LogStash::Inputs::Base
96
96
  process_log(queue, key)
97
97
  backup_to_bucket key unless @backup_bucket.nil?
98
98
  backup_to_local_dir unless @local_dir.nil?
99
- @qs_bucket.delete_object key if @delete_later
99
+ @qs_bucket.delete_object key if @delete_remote_files
100
100
  end
101
101
 
102
102
  # if fetched nothing, just return
@@ -248,7 +248,7 @@ class LogStash::Inputs::Qingstor < LogStash::Inputs::Base
248
248
 
249
249
  public
250
250
  def stop
251
- Stud.stop!(@current_thread)
251
+ Stud.stop!(@current_thread) unless @current_thread.nil?
252
252
  end
253
253
 
254
254
  def directory_valid?(path)
@@ -7,7 +7,7 @@ module LogStash
7
7
  class Qingstor
8
8
  class QingstorValidator
9
9
 
10
- def bucket_valid?(bucket)
10
+ def self.bucket_valid?(bucket)
11
11
  res = bucket.head
12
12
  case res[:status_code]
13
13
  when 401
@@ -18,7 +18,7 @@ module LogStash
18
18
  true
19
19
  end
20
20
 
21
- def prefix_valid?(prefix)
21
+ def self.prefix_valid?(prefix)
22
22
  if prefix.start_with?("/") || prefix.length >= 1024
23
23
  raise LogStash::ConfigurationError, "Prefix must not start with '/' with length less than 1024 "
24
24
  end
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-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 input plugin for QingStor'
6
- s.description = 'Use this plugin to fetch file as a input of logstash from QingStor'
6
+ s.description = 'Use this plugin to fetch file as a input of logstash from Qingstor'
7
7
  s.homepage = 'https://github.com/Tacinight/logstash-input-qingstor'
8
8
  s.authors = ['Evan Zhao']
9
9
  s.email = 'tacingiht@gmail.com'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-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-07 00:00:00.000000000 Z
11
+ date: 2017-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -86,7 +86,7 @@ dependencies:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
- description: Use this plugin to fetch file as a input of logstash from QingStor
89
+ description: Use this plugin to fetch file as a input of logstash from Qingstor
90
90
  email: tacingiht@gmail.com
91
91
  executables: []
92
92
  extensions: []