logstash-output-qingstor 0.2.0 → 0.2.1

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: d1fb6b25a4999d3628887cb326a791afddb002dd
4
- data.tar.gz: d72aca418dc34fe47c11f303c7f48e459a35715c
3
+ metadata.gz: 41089e1e98df15badcfb495f08a3103e8620a3b0
4
+ data.tar.gz: 98da69b9f5cdedd029ed59ef6049fcb52bea57cd
5
5
  SHA512:
6
- metadata.gz: 176d12530d09b496dd051ea70b8694ceda11307b301265114fb64aa46c76564b7a82304489508e37ea0adfedc95656badf0ba0d24aa74236fb06dee5a221835d
7
- data.tar.gz: 4ba9d2490ce1564cf202803346fa8661b83e960743161113a9d3248c89e3d618792d57558c3397d2f224470b17ff5a39805344b80eb40ea306825f75a963ea98
6
+ metadata.gz: 7c46fc69ecbd55569c04805a87ec3d9ee30d4bc9850c46539899ee47d4501dad0cd7cfe68d869da01b5b179d6304e7533ca7efdcc0a8a6954e9f2f7660911dd0
7
+ data.tar.gz: e940a0b9eb73a14ab0d5adc093512b4aca12d443dafa1a559e3eb6da5258e138ca809ec2a0de28f071134aff711810d78228ccbad4ff7620fc98861440e3ee53
data/README.md CHANGED
@@ -1,17 +1,21 @@
1
1
  # Logstash Output Plugin for QingStor
2
2
 
3
+ English | [中文](/README_zh_CN.md)
4
+
3
5
  As an output plugin, it can collect the outputs from logstash, and store them in [QingStor](https://www.qingcloud.com/products/storage#qingstor), which is a remarkable object storage service provided by [QingCloud](https://www.qingcloud.com/).
4
6
 
5
7
  For now, We've submitted this plugin to rubygems.org. Use the following command to install.
6
- ```sh
7
- bin/logstash-plugin install logstash-output-qingstor
8
+
9
+ ``` bash
10
+ $ bin/logstash-plugin install logstash-output-qingstor
8
11
  ```
12
+
9
13
  If want to install the local code, please refer to the following guide to install it manually.
10
14
 
11
- Simplified Chinese version README can be found [here](/README_zh_CN.md)
12
15
  ## 1. Configuration Guide
13
16
 
14
17
  #### 1.1 Run in minimal Configuration Items
18
+
15
19
  ```sh
16
20
  output {
17
21
  qingstor {
@@ -31,19 +35,28 @@ More configuration details please refer to [common options](/docs/index.asciidoc
31
35
  #### 2.1 Run in a local Logstash clone
32
36
 
33
37
  - Edit Logstash `Gemfile` and add the local plugin path, for example:
34
- ```ruby
35
- gem "logstash-output-qingstor", :path => "/your/local/logstash-output-qingstor"
38
+ -
39
+ ``` ruby
40
+ $ gem "logstash-output-qingstor", :path => "/your/local/logstash-output-qingstor"
36
41
  ```
42
+
37
43
  - Install plugin
38
- ```sh
39
- bin/logstash-plugin install --no-verify
44
+ -
45
+ ``` bash
46
+ $ bin/logstash-plugin install --no-verify
40
47
  ```
41
48
  - Run Logstash with your plugin
42
- ```sh
43
- bin/logstash -e "output {qingstor {access_key_id => 'your_access_key_id'
44
- secret_access_key => 'your_secret_access_key'
45
- bucket => 'bucket_name' }}"
49
+
50
+ ```bash
51
+ $ bin/logstash -e "output { \
52
+ qingstor { \
53
+ access_key_id => 'your_access_key_id' \
54
+ secret_access_key => 'your_secret_access_key' \
55
+ bucket => 'bucket_name' \
56
+ } \
57
+ }"
46
58
  ```
59
+
47
60
  At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
48
61
 
49
62
  #### 2.2 Run in an installed Logstash
@@ -51,13 +64,16 @@ At this point any modifications to the plugin code will be applied to this local
51
64
  You can use the same **2.1** method to run your plugin in an installed Logstash by editing its `Gemfile` and pointing the `:path` to your local plugin development directory or you can build the gem and install it using:
52
65
 
53
66
  - Build your plugin gem
54
- ```sh
55
- gem build logstash-output-qingstor.gemspec
67
+
68
+ ``` bash
69
+ $ gem build logstash-output-qingstor.gemspec
56
70
  ```
57
71
  - Install the plugin from the Logstash home
58
- ```sh
59
- bin/logstash-plugin install /your/local/plugin/logstash-output-qingstor.gem
72
+
73
+ ``` bash
74
+ $ bin/logstash-plugin install /your/local/plugin/logstash-output-qingstor.gem
60
75
  ```
76
+
61
77
  - Start Logstash and proceed to test the plugin
62
78
 
63
79
  ## Contributing
data/README_zh_CN.md CHANGED
@@ -1,21 +1,24 @@
1
1
  # Logstash Output Plugin for QingStor
2
2
 
3
- 这是一个适配了[QingStor](https://www.qingcloud.com/products/storage#qingstor), 工作在logstash中的output插件.
4
- QingStor是[QingCloud](https://www.qingcloud.com/)推出的对象存储服务.
5
- 作为一个output插件, 可以将logstash输出的结果打包上传至QingStor中.
3
+ [English](/README.md) | 中文
4
+
5
+ 作为一个 Logstash 的 Output 插件, 它可以将 Logstash 输出的结果打包上传至 QingStor 对象存储中.
6
6
  详细功能参考下面配置说明.
7
7
 
8
- 目前插件已经提交至rubygems.org, 使用以下命令安装:
9
- ```sh
10
- bin/logstash-plugin install logstash-output-qingstor
8
+ 目前插件已经提交至 [RubyGems](https://rubygems.org), 使用以下命令安装:
9
+
10
+ ``` bash
11
+ $ bin/logstash-plugin install logstash-output-qingstor
11
12
  ```
13
+
12
14
  手动安装本地代码, 安装方法参考下文.
13
15
 
14
16
  ## 1. 配置说明
15
17
 
16
18
  #### 1.1 最小运行配置
17
- - 使用'-f'接受一个*.conf文件或者使用'-e'参数时, 最小运行配置至少需要以下三项
18
- ```sh
19
+ - 使用 `-f` 接受一个 `*.conf` 文件或者使用 `-e` 参数直接输入配置, 最小运行配置至少需要以下三项
20
+ -
21
+ ``` bash
19
22
  output {
20
23
  qingstor {
21
24
  access_key_id => 'your_access_key_id' #required
@@ -24,11 +27,11 @@ output {
24
27
  # region => "pek3a" #optional, default value "pek3a"
25
28
  }
26
29
  }
27
-
28
30
  ```
29
31
 
30
32
  #### 1.2 其他可选参数说明
31
- ```sh
33
+
34
+ ``` bash
32
35
  output {
33
36
  qingstor {
34
37
  ......
@@ -76,38 +79,51 @@ output {
76
79
 
77
80
  }
78
81
  }
79
-
80
82
  ```
81
83
 
82
84
  ## 2. 安装插件
83
85
 
84
86
  #### 2.1 直接运行本地的插件
85
87
 
86
- - 编辑Logstash目录下的Genfile, 添加插件的路径, 例如
87
- ```ruby
88
- gem "logstash-output-qingstor", :path => "/your/local/logstash-output-qingstor"
88
+ - 编辑 Logstash 目录下的 Gemfile, 添加插件的路径, 例如
89
+
90
+ ``` ruby
91
+ $ gem "logstash-output-qingstor", :path => "/your/local/logstash-output-qingstor"
89
92
  ```
93
+
90
94
  - 安装插件
91
- ```sh
92
- bin/logstash-plugin install --no-verify
95
+
96
+ ``` bash
97
+ $ bin/logstash-plugin install --no-verify
93
98
  ```
99
+
94
100
  - 使用插件运行
95
- ```sh
96
- bin/logstash -e "output {qingstor {access_key_id => 'your_access_key_id'
97
- secret_access_key => 'your_secret_access_key'
98
- bucket => 'bucket_name' }}"
101
+ -
102
+ ``` bash
103
+ $ bin/logstash -e "output { \
104
+ qingstor { \
105
+ access_key_id => 'your_access_key_id' \
106
+ secret_access_key => 'your_secret_access_key' \
107
+ bucket => 'bucket_name' \
108
+ } \
109
+ }"
99
110
  ```
111
+
100
112
  此时你对插件所做的任意的代码上的修改都会直接生效.
101
113
 
102
114
  #### 2.2 安装一个本地插件然后运行
103
115
 
104
- 这一步你需要生成一个插件的gem包, 然后通过logstash来安装到logstash的插件目录下
105
- - 在项目目录下生成gem
106
- ```sh
107
- gem build logstash-output-qingstor.gemspec
116
+ 这一步你需要生成一个插件的 Gem 包, 然后通过 Logstash 来安装到 Logstash 的插件目录下
117
+ - 在项目目录下生成 Gem
118
+
119
+ ``` bash
120
+ $ gem build logstash-output-qingstor.gemspec
108
121
  ```
109
- - 在Logstash的目录下使用logstash-plugin安装
110
- ```sh
111
- bin/logstash-plugin install /your/local/plugin/logstash-output-qingstor.gem
122
+
123
+ - 在 Logstash 的目录下使用 `logstash-plugin` 安装
124
+
125
+ ``` bash
126
+ $ bin/logstash-plugin install /your/local/plugin/logstash-output-qingstor.gem
112
127
  ```
113
- - 安装完毕之后, 就可以使用Logstash运行开始测试了.
128
+
129
+ - 安装完毕之后, 就可以使用 Logstash 运行开始测试了.
@@ -32,7 +32,7 @@ module LogStash
32
32
  raise LogStash::ConfigurationError, "'file_time' need to "\
33
33
  + 'be greater than 0'
34
34
  end
35
- @file_time = file_time
35
+ @file_time = file_time * 60
36
36
  end
37
37
 
38
38
  def rotate?(file)
@@ -39,7 +39,7 @@ module LogStash
39
39
 
40
40
  upload_headers = {
41
41
  'content_md5' => file_md5,
42
- 'body' => ::File.open(file.path)
42
+ 'body' => ::File.read(file.path)
43
43
  }
44
44
 
45
45
  unless upload_options[:server_side_encryption_algorithm].nil?
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-qingstor'
3
- s.version = '0.2.0'
3
+ s.version = '0.2.1'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = 'logstash output plugin for qingstor'
6
6
  s.description = 'Collect the outputs of logstash and store into Qingstor'
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.2.0
4
+ version: 0.2.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-08-16 00:00:00.000000000 Z
11
+ date: 2017-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement