Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit f43499b

Browse files
author
Brandon Tom
committed
added user agent to plugin and updated version number
1 parent e712891 commit f43499b

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,16 @@ At this point any modifications to the plugin code will be applied to this local
6969

7070
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:
7171

72+
- Install all dependencies of the gem
73+
```sh
74+
bundle install
75+
```
76+
7277
- Build your plugin gem
7378
```sh
7479
gem build logstash-filter-awesome.gemspec
7580
```
81+
7682
- Install the plugin from the Logstash home
7783
```sh
7884
bin/plugin install /your/local/plugin/logstash-filter-awesome.gem

lib/logstash/inputs/dynamodb.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
java_import "com.amazonaws.regions.RegionUtils"
5050

5151
module AmazonDynamoDB
52+
include_package "com.amazonaws"
5253
include_package "com.amazonaws.services.dynamodbv2"
5354
include_package "com.amazonaws.services.dynamodbv2.streamsadapter"
5455
include_package "com.amazonaws.services.dynamodbv2.model"
@@ -75,6 +76,8 @@ module KCL
7576
class LogStash::Inputs::DynamoDB < LogStash::Inputs::Base
7677
config_name "dynamodb"
7778

79+
USER_AGENT = " logstash-input-dynamodb/1.0.0".freeze
80+
7881
LF_DYNAMODB = "dymamodb".freeze
7982
LF_JSON_NO_BIN = "json_drop_binary".freeze
8083
LF_PLAIN = "plain".freeze
@@ -170,7 +173,9 @@ def register
170173
end
171174

172175
#Create DynamoDB Client
173-
@dynamodb_client = AmazonDynamoDB::AmazonDynamoDBClient.new(@credentials)
176+
@client_configuration = AmazonDynamoDB::ClientConfiguration.new()
177+
@client_configuration.setUserAgent(@client_configuration.getUserAgent() + USER_AGENT)
178+
@dynamodb_client = AmazonDynamoDB::AmazonDynamoDBClient.new(@credentials, @client_configuration)
174179

175180
@logger.info(@dynamodb_client.to_s)
176181

@@ -225,7 +230,7 @@ def setup_stream
225230
worker_id = SecureRandom.uuid()
226231
@logger.info("WorkerId: " + worker_id)
227232

228-
dynamodb_streams_client = AmazonDynamoDB::AmazonDynamoDBStreamsClient.new(@credentials)
233+
dynamodb_streams_client = AmazonDynamoDB::AmazonDynamoDBStreamsClient.new(@credentials, @client_configuration)
229234
adapter = Java::ComAmazonawsServicesDynamodbv2Streamsadapter::AmazonDynamoDBStreamsAdapterClient.new(@credentials)
230235
if not @streams_endpoint.nil?
231236
adapter.setEndpoint(@streams_endpoint)

logstash-input-dynamodb.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Gem::Specification.new do |s|
22
s.name = 'logstash-input-dynamodb'
3-
s.version = '0.1.0'
3+
s.version = '1.0.0'
44
s.licenses = ['Apache License (2.0)']
55
s.summary = "This input plugin scans a specified DynamoDB table and then reads changes to a DynamoDB table from the associated DynamoDB Stream."
66
s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
77
s.authors = ["Amazon"]
88
s.email = '[email protected]'
9-
#s.homepage = "[GITHUB/awslabs]"
9+
s.homepage = "https://github.com/logstash-plugins/logstash-input-dynamodb"
1010
s.require_paths = ["lib"]
1111

1212
# Files

0 commit comments

Comments
 (0)