logstash-codec-cloudtrail 3.0.3 → 3.0.4

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
- SHA1:
3
- metadata.gz: a08f5bfbda43d4497e16f4c9b75accf37bce8b5e
4
- data.tar.gz: d8d4b63ff3b9e1e377d3b7483be9fb1ea2ee7ba0
2
+ SHA256:
3
+ metadata.gz: 90d24178bcbdfb7bcd6b7be4a1de10b2dbc4b98c623d274ca2bc1271b4f4a639
4
+ data.tar.gz: 2e6841d6c506b4f2c2048c61bbdda81ff5449a509cbd3c85d072ecd6630c0d40
5
5
  SHA512:
6
- metadata.gz: 9394d292f498544020b67a894920901528f0bdcbff5faefb1c709edb8766b9ca7466db646a66ca5f9c7de4bc685cdb5f245b56d1270f868f90e51969c59e9b5a
7
- data.tar.gz: 075084d8349236d0014a5287d06c7f663f47c8a9cbdeec2e5941f4236702f4754fafa4b0a712e2b26843fcab1bf227446b3ec5fcb562f0587905319440eab446
6
+ metadata.gz: 88cdb1d49878f3fd09b6a58d580a1ba212ff2dc1dc9c404024ef74e9344ca6f1657c8fccf73504b4cc68f4f389ecae8371ff9a454605627c34a6356c22ae33ee
7
+ data.tar.gz: 78ff4cd11692939de1a54d1e9881d2487d71f51fe1ba3c0036562146f6792234973b4cefbb8cad15841e46c76d9214083545110511b2b9e3d46c8db6e446bba1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.0.4
2
+ - Don't crash when data doesn't contain some particular elements
3
+
1
4
  ## 3.0.3
2
5
  - Fix some documentation issues
3
6
 
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012–2016 Elasticsearch <http://www.elastic.co>
1
+ Copyright (c) 2012-2018 Elasticsearch <http://www.elastic.co>
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
@@ -18,15 +18,13 @@ class LogStash::Codecs::CloudTrail < LogStash::Codecs::Base
18
18
  public
19
19
  def decode(data)
20
20
  decoded = LogStash::Json.load(@converter.convert(data))
21
- decoded['Records'].each do |event|
21
+ decoded['Records'].to_a.each do |event|
22
22
  event['@timestamp'] = event.delete('eventTime')
23
23
 
24
- if event.has_key?("requestParameters")
25
- if event['requestParameters'].has_key?("disableApiTermination")
26
- if event['requestParameters']['disableApiTermination'].class != Hash
27
- disableApiTermination = event['requestParameters'].delete('disableApiTermination')
28
- event['requestParameters']['disableApiTermination']= {"value" => disableApiTermination}
29
- end
24
+ if event["requestParameters"] && event['requestParameters'].has_key?("disableApiTermination")
25
+ if event['requestParameters']['disableApiTermination'].class != Hash
26
+ disableApiTermination = event['requestParameters'].delete('disableApiTermination')
27
+ event['requestParameters']['disableApiTermination']= {"value" => disableApiTermination}
30
28
  end
31
29
  end
32
30
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-codec-cloudtrail'
4
- s.version = '3.0.3'
4
+ s.version = '3.0.4'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Process AWS CloudTrail formatted messages"
7
7
  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"
@@ -1 +1,20 @@
1
1
  require "logstash/devutils/rspec/spec_helper"
2
+ require "logstash/plugin"
3
+ require "logstash/codecs/cloudtrail"
4
+
5
+ describe LogStash::Codecs::CloudTrail do
6
+
7
+ describe '#decode' do
8
+ it 'accepts data without a Records property' do
9
+ expect { |b|
10
+ subject.decode('{}', &b)
11
+ }.not_to yield_control
12
+ end
13
+
14
+ it 'accepts records with null requestParameters' do
15
+ expect { |b|
16
+ subject.decode('{"Records":[{"requestParameters":null}]}', &b)
17
+ }.to yield_control
18
+ end
19
+ end
20
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-codec-cloudtrail
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-15 00:00:00.000000000 Z
11
+ date: 2018-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -44,7 +44,9 @@ dependencies:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
- 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
47
+ description: This gem is a Logstash plugin required to be installed on top of the
48
+ Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
49
+ gem is not a stand-alone program
48
50
  email: info@elastic.co
49
51
  executables: []
50
52
  extensions: []
@@ -82,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
84
  version: '0'
83
85
  requirements: []
84
86
  rubyforge_project:
85
- rubygems_version: 2.4.8
87
+ rubygems_version: 2.6.13
86
88
  signing_key:
87
89
  specification_version: 4
88
90
  summary: Process AWS CloudTrail formatted messages