logstash-output-kinesis-iot 0.1.9-java → 0.1.12-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e49da5415d0213c84e1e23d30e0ccabf1869062df0a3a811e014ebf13bea42b
4
- data.tar.gz: a84219def0d32fc43b9099836b4c18a90bfbc085d3b8eee0d285def57f85aff7
3
+ metadata.gz: 5e76a026d37a14d108cc8f158ac2b74dac29385457734e2faadd77229e9115ff
4
+ data.tar.gz: 64b1d735212f6ecc4a63a375e7bc4a7fcdc1d939e0577baf29fa976ba587f99c
5
5
  SHA512:
6
- metadata.gz: bdbdca28b480c127f80f883d1575201fe61062eba7e10cb47f8418722d9fd667733605fb0e71f4c9989bc2cba70efd25f76a280f9f4458d33ec9843de5b3bf1b
7
- data.tar.gz: b196bc3f3775358a6d36c5358f073f7d7b3d86d30e6004c60d18552247349e0d57f26e76a8766880fe23dec702e19b07118aa56e3c1b870cac0c3d7a5d4a23bc
6
+ metadata.gz: 6fd0cb0d7bde124326b11c4157e4f429b37e59852a09b190043098823844f6c2e172f3e77a3f766f05360aa2be271adfe65096d3e89f59f76e17a7295ea5b34a
7
+ data.tar.gz: 2aa08b0deeed5c64fbe1569cbc2ee6ca74ebe89ec9a587895ad30fca55668243c73194c62345b9c55bb568d5a14859b2ae006c451281aa24175a498787664573
@@ -90,6 +90,7 @@ class LogStash::Outputs::KinesisIOT < LogStash::Outputs::Base
90
90
 
91
91
  response = http.request(request)
92
92
  result = JSON.parse(response.body)["credentials"]
93
+ @logger.info("Credentials expire at " +Time.parse(result["expiration"]).to_s)
93
94
  return AWSIOTCreds.new(result["accessKeyId"], result["secretAccessKey"], result["sessionToken"],
94
95
  Time.parse(result["expiration"]))
95
96
  end
@@ -100,12 +101,15 @@ class LogStash::Outputs::KinesisIOT < LogStash::Outputs::Base
100
101
  credentials: Aws::Credentials.new(@creds.accessKeyId, @creds.secretAccessKey, @creds.sessionToken)
101
102
  })
102
103
  # Initialize Kinesis client
104
+ @logger.info("Set AWS Credentials")
103
105
  @kinesis = Aws::Kinesis::Client.new
104
106
  # send data to kinesis
105
107
  end
106
108
  def renew_aws
109
+ @logger.info("Renewing AWS Credentials")
107
110
  @creds = getIotAccess()
108
111
  Aws.config.update({ credentials: Aws::Credentials.new(@creds.accessKeyId, @creds.secretAccessKey, @creds.sessionToken)})
112
+
109
113
  end
110
114
 
111
115
 
@@ -148,6 +152,7 @@ class LogStash::Outputs::KinesisIOT < LogStash::Outputs::Base
148
152
  end
149
153
  def send_record(event, payload)
150
154
  begin
155
+ renew_aws() unless @creds.expiration >= Time.now() + 1
151
156
  response = @kinesis.put_record({
152
157
  stream_name: @stream_name,
153
158
  data: payload,
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-kinesis-iot'
3
- s.version = '0.1.9'
3
+ s.version = '0.1.12'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = "Sends data to a AWS kinesis, "
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 gemname. This gem is not a stand-alone program"
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.email = "jeremy@frandon.net"
9
9
  s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
10
10
  s.require_paths = ["lib"]
11
- s.platform = Gem::Platform::JAVA #if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
11
+ s.platform = "java" #if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
12
12
  # Files
13
13
  s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
14
14
  # Tests
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-kinesis-iot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.12
5
5
  platform: java
6
6
  authors:
7
7
  - Jeremy Frandon