logstash-output-awslogs 0.1.15 → 0.1.20

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: 29735655683e0bf0d17d8726372472e951cbfc3c
4
- data.tar.gz: 81fe5f0b3430e382cd049984cde731332f676252
2
+ SHA256:
3
+ metadata.gz: a17afa9328ef3d785b0ff6cbd00b60db09fa3f64f8dec15c93b587b00ff8bad7
4
+ data.tar.gz: e343fe4e97dfe5ea2dbd7c4949be7e8d5b59a6880249c7a21fa8f3409aadfbc7
5
5
  SHA512:
6
- metadata.gz: 5f35c56827166827987c39716260dd1435f2ac0d7071208e674e6cf27d1a6102c9ae24e4cbac3fb67fce978499f5ce15e9e66eec61b07ca0c5b522c2e7c23068
7
- data.tar.gz: 22eadde7bcff23206e3c99d87c5b0545de942e7f348260f8831a490565b206fc75f5b6d092db15a0091d7f512561d79698532e2da525d6da67412fabed580b81
6
+ metadata.gz: 64487c9cb52c41e5ca319f1fac727ebda10c30118d6ba6009db4b3f33d1ace0965e669c5d7080d978d5a63f1682ebdec04362def17749b6d3c4549f3af58dd89
7
+ data.tar.gz: f377fb99c2c526528d64298ce7841f9b84d8c6df1a30b4f8b7534dd65861b57e944f8ff66f9bb56f9e9198cc015ee988f7183581862816146cc73f343801e8c1
data/Gemfile CHANGED
@@ -1,3 +1,2 @@
1
1
  source 'https://rubygems.org'
2
- gemspec
3
- gem "logstash", :github => "elastic/logstash", :branch => "6.4"
2
+ gemspec
@@ -46,35 +46,27 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
46
46
 
47
47
  to_send.each do |event_log_names, _events|
48
48
  event_log_group_name = event_log_names[0]
49
- event_log_stream_name = event_log_names[1]
50
49
  next if sequence_tokens.keys.include? event_log_group_name
51
50
 
52
51
  sequence_tokens.store(event_log_group_name, {})
53
52
  begin
54
- @client.describe_log_streams(log_group_name: event_log_group_name).each do |response|
53
+ @client.describe_log_streams({log_group_name: event_log_group_name}).each do |response|
55
54
  response.log_streams.each do |log_stream_data|
56
- sequence_tokens[event_log_group_name][log_stream_data.log_stream_name.to_s] = log_stream_data.upload_sequence_token.to_s
55
+ unless log_stream_data.upload_sequence_token&.empty?
56
+ sequence_tokens[event_log_group_name][log_stream_data.log_stream_name.to_s] = log_stream_data.upload_sequence_token.to_s
57
+ end
57
58
  end
58
59
  end
59
60
  rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
60
61
  @logger.info('Will create log group/stream and retry')
61
62
  begin
62
- @client.create_log_group(log_group_name: event_log_group_name)
63
+ @client.create_log_group({log_group_name: event_log_group_name})
63
64
  rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
64
65
  @logger.info("Log group #{event_log_group_name} already exists")
65
- rescue Exception => e
66
- @logger.error(e)
67
- end
68
- begin
69
- @client.create_log_stream(log_group_name: event_log_group_name, log_stream_name: event_log_stream_name)
70
- rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
71
- @logger.info("Log stream #{event_log_stream_name} already exists")
72
- rescue Exception => e
73
- @logger.error(e)
74
66
  end
75
67
  retry
76
68
  rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
77
- @logger.info('Logs throttling, retry')
69
+ @logger.info('Describe streams throttling, retry')
78
70
  retry
79
71
  end
80
72
  end
@@ -94,39 +86,29 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
94
86
 
95
87
  if @next_sequence_tokens.keys.include? next_sequence_token_key
96
88
  send_opts[:sequence_token] = @next_sequence_tokens[next_sequence_token_key]
97
- elsif sequence_tokens[event_log_group_name].keys.include? event_log_stream_name
89
+ elsif !sequence_tokens[event_log_group_name][event_log_stream_name]&.empty?
98
90
  send_opts[:sequence_token] = sequence_tokens[event_log_group_name][event_log_stream_name]
99
91
  else
100
92
  begin
101
93
  @client.create_log_stream(ident_opts)
102
- until sequence_tokens[event_log_group_name].key?(event_log_stream_name) && !sequence_tokens[event_log_group_name][event_log_stream_name].to_s.empty?
103
- @client.describe_log_streams(log_group_name: event_log_group_name).each do |response|
104
- response.log_streams.each do |log_stream_data|
105
- sequence_tokens[event_log_group_name][log_stream_data.log_stream_name.to_s] = log_stream_data.upload_sequence_token.to_s
106
- end
107
- end
108
- end
109
- send_opts[:sequence_token] = sequence_tokens[event_log_group_name][event_log_stream_name]
110
94
  rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
111
95
  @logger.info('Will create log group/stream and retry')
112
96
  begin
113
- @client.create_log_group(log_group_name: send_opts[:log_group_name])
97
+ @client.create_log_group({log_group_name: send_opts[:log_group_name]})
114
98
  rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
115
99
  @logger.info("Log group #{send_opts[:log_group_name]} already exists")
116
- rescue Exception => e
117
- @logger.error(e)
118
100
  end
119
101
  begin
120
- @client.create_log_stream(log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name])
102
+ @client.create_log_stream({log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name]})
121
103
  rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
122
104
  @logger.info("Log stream #{send_opts[:log_stream_name]} already exists")
123
- rescue Exception => e
124
- @logger.error(e)
125
105
  end
126
106
  retry
127
107
  rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
128
- @logger.info('Logs throttling, retry')
108
+ @logger.info('Creating log streams throttling, retry')
129
109
  retry
110
+ rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
111
+ @logger.info("Log stream #{send_opts[:log_stream_name]} already exists")
130
112
  end
131
113
  end
132
114
  begin
@@ -135,26 +117,20 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
135
117
  rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
136
118
  @logger.info('Will create log group/stream and retry')
137
119
  begin
138
- @client.create_log_group(log_group_name: send_opts[:log_group_name])
120
+ @client.create_log_group({log_group_name: send_opts[:log_group_name]})
139
121
  rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
140
122
  @logger.info("Log group #{send_opts[:log_group_name]} already exists")
141
- rescue Exception => e
142
- @logger.error(e)
143
123
  end
144
124
  begin
145
- @client.create_log_stream(log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name])
125
+ @client.create_log_stream({log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name]})
146
126
  rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
147
127
  @logger.info("Log stream #{send_opts[:log_stream_name]} already exists")
148
- rescue Exception => e
149
- @logger.error(e)
150
128
  end
151
129
  retry
152
130
  # TODO: handle rejected events with debug message
153
131
  rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
154
132
  @logger.info('Logs throttling, retry')
155
133
  retry
156
- rescue Exception => e
157
- @logger.error(e)
158
134
  end
159
135
  end
160
136
  end # def multi_receive_encoded
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-awslogs'
3
- s.version = '0.1.15'
3
+ s.version = '0.1.20'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = 'Writes events to AWS CloudWatch logs.'
6
6
  s.homepage = 'https://github.com/rickycook/logstash-output-awslogs'
@@ -21,4 +21,5 @@ Gem::Specification.new do |s|
21
21
  s.add_runtime_dependency "logstash-codec-plain"
22
22
  s.add_runtime_dependency 'logstash-mixin-aws', '>= 4.3.0'
23
23
  s.add_development_dependency "logstash-devutils"
24
+ s.add_development_dependency "aws-sdk-cloudwatchlogs"
24
25
  end
metadata CHANGED
@@ -1,72 +1,86 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-awslogs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Klyba
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2020-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: logstash-core-plugin-api
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
18
  version: '2.0'
20
- type: :runtime
19
+ name: logstash-core-plugin-api
21
20
  prerelease: false
21
+ type: :runtime
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: logstash-codec-plain
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
32
  version: '0'
34
- type: :runtime
33
+ name: logstash-codec-plain
35
34
  prerelease: false
35
+ type: :runtime
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: logstash-mixin-aws
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - ">="
46
45
  - !ruby/object:Gem::Version
47
46
  version: 4.3.0
48
- type: :runtime
47
+ name: logstash-mixin-aws
49
48
  prerelease: false
49
+ type: :runtime
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 4.3.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: logstash-devutils
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - ">="
60
59
  - !ruby/object:Gem::Version
61
60
  version: '0'
61
+ name: logstash-devutils
62
+ prerelease: false
62
63
  type: :development
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ name: aws-sdk-cloudwatchlogs
63
76
  prerelease: false
77
+ type: :development
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - ">="
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
- description:
83
+ description:
70
84
  email: anarhyst266+gems@gmail.com
71
85
  executables: []
72
86
  extensions: []
@@ -86,7 +100,7 @@ licenses:
86
100
  metadata:
87
101
  logstash_plugin: 'true'
88
102
  logstash_group: output
89
- post_install_message:
103
+ post_install_message:
90
104
  rdoc_options: []
91
105
  require_paths:
92
106
  - lib
@@ -101,9 +115,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
115
  - !ruby/object:Gem::Version
102
116
  version: '0'
103
117
  requirements: []
104
- rubyforge_project:
105
- rubygems_version: 2.5.2.3
106
- signing_key:
118
+ rubyforge_project:
119
+ rubygems_version: 2.6.11
120
+ signing_key:
107
121
  specification_version: 4
108
122
  summary: Writes events to AWS CloudWatch logs.
109
123
  test_files: []