logstash-output-oss 0.1.1-java → 0.1.2-java

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
  SHA256:
3
- metadata.gz: 1d607407845973f61ed5a1db2e22fbf3d99f160131ce6d5b82b769ed2befc137
4
- data.tar.gz: 3735dd4691fd97ee642bab10479ee08a574659c3658f99f620851d64d5e0710d
3
+ metadata.gz: 4a2bacb1c26954ebf84fe7ea6ceb37cb392613ac2ea167cd96b6193fce9272d0
4
+ data.tar.gz: 9222d3ff4b9a34306d3117c30d55741a99d55399680a8073a74f458c405e25ad
5
5
  SHA512:
6
- metadata.gz: 8bb4fd199bf14b90c6091256b2ce517ba9ebf41ebd9bee90d167489f4d80bfd54d9c94e13207b2391f0edb42d7cfc04067b27c6a190eda7d17976a56274e0c4e
7
- data.tar.gz: d2113870411fe783374e66d20c5eb43ddd91f0bfdb94cda80bd329d767140c229a221a951f4be5dc0ba658ce3ac7bccaf22d1b977d802bf40c85f56f1dee1777
6
+ metadata.gz: 8e9ae40c9231808a93943aae6dd466014e958082f02a8d625ddc876c00db428846ba24d295a05a7275a5ee833fe31a6b9fc4c6f9a394446b627b5bc2f907f2ae
7
+ data.tar.gz: 8a1dc6b59deaaf708a1991df1c0549ebafffc1473a64e9d67dbb66581994df23e9de99b0eebee04b120a08c8f4366f69dd69aab54388b38fd2337becba0436b0
data/CHANGELOG.md CHANGED
@@ -1,2 +1,4 @@
1
1
  ## 0.1.1
2
2
  - First release to support OSS
3
+ ## 0.1.2
4
+ - Optimize file generator
data/README.md CHANGED
@@ -44,7 +44,7 @@ input {
44
44
 
45
45
  output {
46
46
  oss {
47
- "endpoint" => "oss-cn-zhangjiakou.aliyuncs.com" (required)
47
+ "endpoint" => "OSS endpoint to connect to" (required)
48
48
  "bucket" => "Your bucket name" (required)
49
49
  "access_key_id" => "Your access key id" (required)
50
50
  "access_key_secret" => "Your access secret key" (required)
@@ -56,7 +56,7 @@ output {
56
56
  "encoding" => "gzip" (optional, default = "none")
57
57
  "additional_oss_settings" => {
58
58
  "max_connections_to_oss" => 1024 (optional, default = 1024)
59
- "secure_connection_enabled" => false (optional, default = true)
59
+ "secure_connection_enabled" => false (optional, default = false)
60
60
  }
61
61
  codec => json {
62
62
  charset => "UTF-8"
@@ -88,6 +88,29 @@ This plugin supports the following configuration options
88
88
 
89
89
  Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
90
90
 
91
+ ## Deployment
92
+ This plugin has been submitted to [RubyGems.org](https://rubygems.org/gems/logstash-output-oss), and Logstash uses RubyGems.org as its repository for all plugin artifacts.
93
+ So you can simply install this plugin in your Logstash home directory by:
94
+
95
+ ```bash
96
+ ./bin/logstash-plugin install logstash-output-oss
97
+ ```
98
+ And you will get following message:
99
+
100
+ ```bash
101
+ Validating logstash-output-oss
102
+ Installing logstash-output-oss
103
+ com.aliyun.oss:aliyun-sdk-oss:3.4.0:compile
104
+ Installation successful
105
+ ```
106
+
107
+ You can also list plugins by:
108
+ ```bash
109
+ ./bin/logstash-plugin list --verbose logstash-output-oss
110
+
111
+ logstash-output-oss (0.1.1)
112
+ ```
113
+
91
114
  ## Developing
92
115
 
93
116
  ### 1. Plugin Developement and Testing
@@ -129,7 +152,7 @@ gem build logstash-output-oss.gemspec
129
152
  - Install the plugin from the Logstash home
130
153
 
131
154
  ```sh
132
- bin/logstash-plugin install /path/to/logstash-output-oss-0.1.0-java.gem
155
+ bin/logstash-plugin install /path/to/logstash-output-oss-0.1.1-java.gem
133
156
  ```
134
157
 
135
158
  - Start Logstash and proceed to test the plugin
@@ -14,7 +14,7 @@ java_import "com.aliyun.oss.ClientBuilderConfiguration"
14
14
  # In order to write output data to OSS, you should add configurations like below to logstash
15
15
  # output {
16
16
  # oss {
17
- # "endpoint" => "oss-cn-zhangjiakou.aliyuncs.com" (required)
17
+ # "endpoint" => "OSS endpoint to connect to" (required)
18
18
  # "bucket" => "Your bucket name" (required)
19
19
  # "access_key_id" => "Your access key id" (required)
20
20
  # "access_key_secret" => "Your access secret key" (required)
@@ -26,7 +26,7 @@ java_import "com.aliyun.oss.ClientBuilderConfiguration"
26
26
  # "encoding" => "none" (optional, default = "none")
27
27
  # "additional_oss_settings" => {
28
28
  # "max_connections_to_oss" => 1024 (optional, default = 1024)
29
- # "secure_connection_enabled" => false (optional, default = true)
29
+ # "secure_connection_enabled" => false (optional, default = false)
30
30
  # }
31
31
  # }
32
32
  # }
@@ -49,7 +49,7 @@ module LogStash
49
49
 
50
50
  private
51
51
  def create_file
52
- uuid = UUID.new.generate
52
+ uuid = SecureRandom.uuid
53
53
  file_name = "ls.oss.#{uuid}.#{Time.now.strftime(STRFTIME)}.part-#{index}.#{extension}"
54
54
  object_key = ::File.join(prefix, file_name)
55
55
  local_path = ::File.join(temporary_directory, uuid)
@@ -63,6 +63,17 @@ module LogStash
63
63
 
64
64
  TemporaryFile.new(file, object_key, local_path)
65
65
  end
66
+
67
+ unless SecureRandom.respond_to?(:uuid)
68
+ module SecureRandom
69
+ def self.uuid
70
+ ary = random_bytes(16).unpack("NnnnnN")
71
+ ary[2] = (ary[2] & 0x0fff) | 0x4000
72
+ ary[3] = (ary[3] & 0x3fff) | 0x8000
73
+ "%08x-%04x-%04x-%04x-%04x%08x" % ary
74
+ end
75
+ end
76
+ end
66
77
  end
67
78
  end
68
79
  end
@@ -4,7 +4,7 @@ module LogStash
4
4
  module Outputs
5
5
  class OSS
6
6
  class Version
7
- VERSION = "0.1.1"
7
+ VERSION = "0.1.2"
8
8
  def self.version
9
9
  VERSION
10
10
  end
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-oss'
3
- s.version = '0.1.1'
3
+ s.version = '0.1.2'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = 'Sends Logstash events to the Aliyun Object Storage Service'
6
6
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gem-name. This gem is not a stand-alone program"
7
- s.authors = ['jinhu.wu']
7
+ s.authors = ['Jinhu Wu']
8
8
  s.email = 'jinhu.wu.nju@gmail.com'
9
9
  s.require_paths = ['lib']
10
10
  s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-oss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: java
6
6
  authors:
7
- - jinhu.wu
7
+ - Jinhu Wu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-02 00:00:00.000000000 Z
11
+ date: 2019-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement