logstash-output-oss 0.1.1-java → 0.1.2-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/README.md +26 -3
- data/lib/logstash/outputs/oss.rb +2 -2
- data/lib/logstash/outputs/oss/file_generator.rb +12 -1
- data/lib/logstash/outputs/oss/version.rb +1 -1
- data/logstash-output-oss.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a2bacb1c26954ebf84fe7ea6ceb37cb392613ac2ea167cd96b6193fce9272d0
|
4
|
+
data.tar.gz: 9222d3ff4b9a34306d3117c30d55741a99d55399680a8073a74f458c405e25ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e9ae40c9231808a93943aae6dd466014e958082f02a8d625ddc876c00db428846ba24d295a05a7275a5ee833fe31a6b9fc4c6f9a394446b627b5bc2f907f2ae
|
7
|
+
data.tar.gz: 8a1dc6b59deaaf708a1991df1c0549ebafffc1473a64e9d67dbb66581994df23e9de99b0eebee04b120a08c8f4366f69dd69aab54388b38fd2337becba0436b0
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -44,7 +44,7 @@ input {
|
|
44
44
|
|
45
45
|
output {
|
46
46
|
oss {
|
47
|
-
"endpoint" => "
|
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 =
|
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.
|
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
|
data/lib/logstash/outputs/oss.rb
CHANGED
@@ -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" => "
|
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 =
|
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 =
|
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
|
data/logstash-output-oss.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-oss'
|
3
|
-
s.version = '0.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 = ['
|
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.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Jinhu Wu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
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
|