logstash-output-kinesis 1.6.0-java → 2.0.0-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 +8 -8
- data/README.md +2 -27
- data/lib/logstash-output-kinesis/version.rb +1 -1
- data/lib/logstash/outputs/kinesis.rb +11 -29
- data/logstash-output-kinesis.gemspec +4 -9
- data/spec/outputs/kinesis_spec.rb +1 -1
- metadata +14 -28
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDBjODYwYzVmN2E0OTYxMWUzMTdhZWU2YjZlZmI3YWRkNzIxZWYwMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Njc5MmRhOWNhMThiYWE1NTZlOTdlNGI4ZTFmOGM5YTc3YzViMmIxNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjQ0YTMwMGM1NWQ1OWUwNDRhMTVhZWFmNjA5NDAxMWNkNWExMDVjZTdiOGM1
|
10
|
+
MjRjMGZjNmYyNjY2Mzk3ZDZiMmUwY2MyMTlhODIxNDZhNDY4OWQwMmY4NWIy
|
11
|
+
ZWE1YTVmYjNkMDk2MTAzZGQ0NWJmYTE4ZTM2YTIxNThjMzE4Nzk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjMxMjMwOTc4MTkzMjNjYTI0OTFmZGY3YThlYTNlNjMzNjA2MGI5ZGVjNTY4
|
14
|
+
ZjRmZDE0ZmFlNTMwZGZkZWFlNGMxZDU0MDI5ZDg1MTRhNWYzOTc5MWFmNTEy
|
15
|
+
YTQ3YWU0MDFkODIxNjg3MmNkMjE0ODllNDRhN2RjNWY4ZDczMGI=
|
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
# Kinesis Output Plugin
|
1
|
+
# Kinesis Output Plugin
|
2
2
|
|
3
3
|
[![Build Status][badge-travis]][travis]
|
4
4
|
[![Gem info][badge-gem]][rubygems]
|
5
5
|
|
6
6
|
This is a plugin for [Logstash](https://github.com/elasticsearch/logstash). It will send log records to a [Kinesis stream](https://aws.amazon.com/kinesis/), using the [Kinesis Producer Library (KPL)](https://docs.aws.amazon.com/kinesis/latest/dev/developing-producers-with-kpl.html).
|
7
7
|
|
8
|
-
**This version is intended for use with Logstash
|
8
|
+
**This version is intended for use with Logstash 2.x. Please use a [1.5.x](https://github.com/samcday/logstash-output-kinesis/tree/1.5) version of this plugin for Logstash 1.5.x compatibility.**
|
9
9
|
|
10
10
|
|
11
11
|
## Configuration
|
@@ -104,18 +104,6 @@ output {
|
|
104
104
|
}
|
105
105
|
```
|
106
106
|
|
107
|
-
#### Randomised partition keys
|
108
|
-
|
109
|
-
If you don't care about the ordering of your logs in the Kinesis stream, you might want to use a random partition key. This way, your log stream will be more or less uniformly spread across all available shards in the Kinesis stream.
|
110
|
-
|
111
|
-
```nginx
|
112
|
-
output {
|
113
|
-
kinesis {
|
114
|
-
randomized_partition_key => true
|
115
|
-
}
|
116
|
-
}
|
117
|
-
```
|
118
|
-
|
119
107
|
### Record Aggregation
|
120
108
|
|
121
109
|
The [Amazon KPL library can aggregate](https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-kpl-concepts.html#d0e3423) your records when writing to the Kinesis stream. **This behaviour is configured to be enabled by default.**
|
@@ -132,19 +120,6 @@ output {
|
|
132
120
|
}
|
133
121
|
```
|
134
122
|
|
135
|
-
### Backpressure
|
136
|
-
|
137
|
-
The KPL library does not force any backpressure. This means if Kinesis is unavailable or throttling, KPL will happily accept records until it chews up all available memory on your machine. This plugin has a default backpressure mechanism - if there's more than 1000 pending records to be written to Kinesis, then further log records will block. This will cause Logstash to block further processing until everything is flushed out to Kinesis. I know that sounds lame, but it's better than the Linux OOM killer stepping in and breaking all your shit, no?
|
138
|
-
|
139
|
-
Anyway, if you want to throw more memory / CPU cycles at buffering lots of stuff before it makes it to Kinesis, you can control the high-watermark:
|
140
|
-
|
141
|
-
```nginx
|
142
|
-
output {
|
143
|
-
kinesis {
|
144
|
-
max_pending_records => 10000 # I sure as hell hope you know what you're doing.
|
145
|
-
}
|
146
|
-
}
|
147
|
-
```
|
148
123
|
|
149
124
|
## Known Issues
|
150
125
|
|
@@ -3,7 +3,6 @@
|
|
3
3
|
require "java"
|
4
4
|
require "logstash/outputs/base"
|
5
5
|
require "logstash/namespace"
|
6
|
-
require "securerandom"
|
7
6
|
require "logstash-output-kinesis_jars"
|
8
7
|
|
9
8
|
# Sends log events to a Kinesis stream. This output plugin uses the official Amazon KPL.
|
@@ -18,11 +17,6 @@ class LogStash::Outputs::Kinesis < LogStash::Outputs::Base
|
|
18
17
|
config :stream_name, :validate => :string, :required => true
|
19
18
|
# A list of event data keys to use when constructing a partition key
|
20
19
|
config :event_partition_keys, :validate => :array, :default => []
|
21
|
-
# If true, a random partition key will be assigned to each log record
|
22
|
-
config :randomized_partition_key, :validate => :boolean, :default => false
|
23
|
-
# If the number of records pending being written to Kinesis exceeds this number, then block
|
24
|
-
# Logstash processing until they're all written.
|
25
|
-
config :max_pending_records, :validate => :number, :default => 1000
|
26
20
|
|
27
21
|
# An AWS access key to use for authentication to Kinesis and CloudWatch
|
28
22
|
config :access_key, :validate => :string
|
@@ -84,23 +78,19 @@ class LogStash::Outputs::Kinesis < LogStash::Outputs::Base
|
|
84
78
|
def receive(event)
|
85
79
|
return unless output?(event)
|
86
80
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
# Haha - gawd. If I don't put an empty string in the array, then calling .join()
|
91
|
-
# on it later will result in a US-ASCII string if the array is empty. Ruby is awesome.
|
92
|
-
partition_key_parts = [""]
|
93
|
-
|
94
|
-
@event_partition_keys.each do |partition_key_name|
|
95
|
-
if not event[partition_key_name].nil? and event[partition_key_name].length > 0
|
96
|
-
partition_key_parts << event[partition_key_name].to_s
|
97
|
-
break
|
98
|
-
end
|
99
|
-
end
|
81
|
+
# Haha - gawd. If I don't put an empty string in the array, then calling .join()
|
82
|
+
# on it later will result in a US-ASCII string if the array is empty. Ruby is awesome.
|
83
|
+
partition_key_parts = [""]
|
100
84
|
|
101
|
-
|
85
|
+
@event_partition_keys.each do |partition_key_name|
|
86
|
+
if not event[partition_key_name].nil? and event[partition_key_name].length > 0
|
87
|
+
partition_key_parts << event[partition_key_name].to_s
|
88
|
+
break
|
89
|
+
end
|
102
90
|
end
|
103
91
|
|
92
|
+
event["[@metadata][partition_key]"] = (partition_key_parts * "-").to_s[/.+/m] || "-"
|
93
|
+
|
104
94
|
begin
|
105
95
|
@codec.encode(event)
|
106
96
|
rescue => e
|
@@ -109,10 +99,9 @@ class LogStash::Outputs::Kinesis < LogStash::Outputs::Base
|
|
109
99
|
end
|
110
100
|
|
111
101
|
public
|
112
|
-
def
|
102
|
+
def close
|
113
103
|
@producer.flushSync()
|
114
104
|
@producer.destroy()
|
115
|
-
finished()
|
116
105
|
end
|
117
106
|
|
118
107
|
def create_kpl_config
|
@@ -194,13 +183,6 @@ class LogStash::Outputs::Kinesis < LogStash::Outputs::Base
|
|
194
183
|
rescue => e
|
195
184
|
@logger.warn("Error writing event to Kinesis", :exception => e)
|
196
185
|
end
|
197
|
-
|
198
|
-
num = @producer.getOutstandingRecordsCount()
|
199
|
-
if num > @max_pending_records
|
200
|
-
@logger.warn("Kinesis is too busy - blocking until things have cleared up")
|
201
|
-
@producer.flushSync()
|
202
|
-
@logger.info("Okay - I've stopped blocking now")
|
203
|
-
end
|
204
186
|
end
|
205
187
|
end
|
206
188
|
|
@@ -27,14 +27,9 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.platform = "java"
|
28
28
|
|
29
29
|
# Gem dependencies
|
30
|
-
s.add_runtime_dependency "logstash-core", ">=
|
31
|
-
s.add_runtime_dependency "logstash-codec-plain", "<
|
32
|
-
s.add_runtime_dependency "logstash-codec-json", "<
|
33
|
-
s.add_development_dependency "logstash-devutils"
|
30
|
+
s.add_runtime_dependency "logstash-core", ">= 2.0.0", "< 3.0.0"
|
31
|
+
s.add_runtime_dependency "logstash-codec-plain", "< 3.0.0"
|
32
|
+
s.add_runtime_dependency "logstash-codec-json", "< 3.0.0"
|
33
|
+
s.add_development_dependency "logstash-devutils"
|
34
34
|
s.add_development_dependency "gem-release", "~>0.7.3"
|
35
|
-
|
36
|
-
# Temporary hack because Logstash devs are crazy.
|
37
|
-
# See: https://github.com/elastic/logstash/issues/4141
|
38
|
-
# We should be able to remove this once logstash-core >2.0.0 && >1.5.5 are released
|
39
|
-
s.add_development_dependency "concurrent-ruby", "0.9.1"
|
40
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-kinesis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Sam Day
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-core
|
@@ -16,62 +16,62 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.0
|
20
20
|
- - <
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: 3.0.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 2.0.0
|
30
30
|
- - <
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 3.0.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: logstash-codec-plain
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - <
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: 3.0.0
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - <
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
46
|
+
version: 3.0.0
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: logstash-codec-json
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - <
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: 3.0.0
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - <
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
60
|
+
version: 3.0.0
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: logstash-devutils
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- -
|
65
|
+
- - ! '>='
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
67
|
+
version: '0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- -
|
72
|
+
- - ! '>='
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
74
|
+
version: '0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: gem-release
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,20 +86,6 @@ dependencies:
|
|
86
86
|
- - ~>
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: 0.7.3
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: concurrent-ruby
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - '='
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: 0.9.1
|
96
|
-
type: :development
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - '='
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: 0.9.1
|
103
89
|
description: This gem is a logstash plugin required to be installed on top of the
|
104
90
|
Logstash core pipeline using $LS_HOME/bin/plugin install logstash-output-kinesis.
|
105
91
|
This gem is not a stand-alone program
|