logstash-output-kinesis 1.5.0-java → 1.5.1-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 +12 -0
- data/lib/logstash-output-kinesis/version.rb +1 -1
- data/lib/logstash/outputs/kinesis.rb +17 -10
- data/logstash-output-kinesis.gemspec +5 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDE4OTkzNDRlNzYzN2FiYThkMDZkYTgwZWViYTdmY2UxZDkzN2Y5ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MWFmYjg5NjdiNGMyOTEzODIzNTExMjAzNGYwOGY5MTE0OGJkMGI4Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODNjZmFhMjllNjhmMjI2MDcwNDNiZGUxY2JiNjc1YWMzNTI1YzdlNzhjODg5
|
10
|
+
MzgyYzdhYjllNzNlMzQ5OGY1ZjViOGVhMzczZWE4YjQ5NDI1ZjMyYTU0MDYx
|
11
|
+
OGFlNTI0YTFlZjkwODFkMzM1NDQ4YjkzNjAyMGQzMTYyYzRiNWU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzhlNWFhYzk3MGQyNjc3YjQ3OGEwYWNkYmUyMGFiNjM4MGM1MWY1Nzk3OGQ5
|
14
|
+
OTdhMTliNzRlYTE3MzUxMzBkM2I0MDlmMTYzYzk0ZWU1ZGQ0YWE0NDhjMGFj
|
15
|
+
MWExMGNiZGM2MzMwMDE0ZTc5YWNmOWY4ZGVlNTMzMTg2MzBlZjA=
|
data/README.md
CHANGED
@@ -104,6 +104,18 @@ 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
|
+
|
107
119
|
### Record Aggregation
|
108
120
|
|
109
121
|
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.**
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require "java"
|
4
4
|
require "logstash/outputs/base"
|
5
5
|
require "logstash/namespace"
|
6
|
+
require "securerandom"
|
6
7
|
require "logstash-output-kinesis_jars"
|
7
8
|
|
8
9
|
# Sends log events to a Kinesis stream. This output plugin uses the official Amazon KPL.
|
@@ -17,6 +18,8 @@ class LogStash::Outputs::Kinesis < LogStash::Outputs::Base
|
|
17
18
|
config :stream_name, :validate => :string, :required => true
|
18
19
|
# A list of event data keys to use when constructing a partition key
|
19
20
|
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
|
20
23
|
|
21
24
|
# An AWS access key to use for authentication to Kinesis and CloudWatch
|
22
25
|
config :access_key, :validate => :string
|
@@ -78,18 +81,22 @@ class LogStash::Outputs::Kinesis < LogStash::Outputs::Base
|
|
78
81
|
def receive(event)
|
79
82
|
return unless output?(event)
|
80
83
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
84
|
+
if @randomized_partition_key
|
85
|
+
event["[@metadata][partition_key]"] = SecureRandom.uuid
|
86
|
+
else
|
87
|
+
# Haha - gawd. If I don't put an empty string in the array, then calling .join()
|
88
|
+
# on it later will result in a US-ASCII string if the array is empty. Ruby is awesome.
|
89
|
+
partition_key_parts = [""]
|
90
|
+
|
91
|
+
@event_partition_keys.each do |partition_key_name|
|
92
|
+
if not event[partition_key_name].nil? and event[partition_key_name].length > 0
|
93
|
+
partition_key_parts << event[partition_key_name].to_s
|
94
|
+
break
|
95
|
+
end
|
89
96
|
end
|
90
|
-
end
|
91
97
|
|
92
|
-
|
98
|
+
event["[@metadata][partition_key]"] = (partition_key_parts * "-").to_s[/.+/m] || "-"
|
99
|
+
end
|
93
100
|
|
94
101
|
begin
|
95
102
|
@codec.encode(event)
|
@@ -32,4 +32,9 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.add_runtime_dependency "logstash-codec-json", "< 2.0.0"
|
33
33
|
s.add_development_dependency "logstash-devutils", "< 2.0.0"
|
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"
|
35
40
|
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: 1.5.
|
4
|
+
version: 1.5.1
|
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-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-core
|
@@ -86,6 +86,20 @@ 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
|
89
103
|
description: This gem is a logstash plugin required to be installed on top of the
|
90
104
|
Logstash core pipeline using $LS_HOME/bin/plugin install logstash-output-kinesis.
|
91
105
|
This gem is not a stand-alone program
|