logstash-output-awslogs 0.1.24 → 0.1.29

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: 6c79c590f6a8db8e37f39e91dfabe4f17697bd02d29aaa1a36148d4780eafe0b
4
- data.tar.gz: f646423c73d78e6ed3861af4fb27952c5c12e626fc0f4b35060b2ce0a5661d94
3
+ metadata.gz: a6d187d9a46e3d3b58b9cc7782499de7de990eca4eb2ba212b03abe8ff29d42e
4
+ data.tar.gz: 217c5ae517cfc1333ec150499be174543087a9063374a1a65ae66fcc3525f909
5
5
  SHA512:
6
- metadata.gz: 07d4fc8717742ceb35b20d1ed6be7e9a0f6ae058b19c7fbf9384ffa2be91565e3007e01a39d6aebd3f2c16ee7095f61b6e0b24343e2ff86e9c4211d8daac8480
7
- data.tar.gz: 4097286d38c5bc9ef062a3974012d36e54e8b3444471fcd82db0d91400c9fb2a8c4f2c6277896c1fae3cdb1d8b4e4eac30824d426b7288b889fdc552f36d99dc
6
+ metadata.gz: deccb83b39e6b80517fc1682fd877a385c60c1ff0ff82854dc87f12950a6399a7d9a025cb14602965ea841e7daee35a6be3e0d3eaa62ad8c969e56f26982f2fb
7
+ data.tar.gz: eec9cb42b0ffc31a6b7a39ca1d53fb0eea33bc4494b47e2a80dfd1d7efb1dd08fb12ffc3b843476ca9ae3ee06d2a518064d5701f4486fe624c53fc76066ffff6
@@ -38,15 +38,15 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
38
38
  unless to_send.keys.include? next_sequence_token_key
39
39
  to_send.store(next_sequence_token_key, [])
40
40
  end
41
- if event.get('message')&.empty?
41
+ if event.get('message') && !event.get('message').empty?
42
42
  to_send[next_sequence_token_key].push(
43
43
  timestamp: (event.timestamp.time.to_f * 1000).to_int,
44
- message: encoded
44
+ message: event.get('message')
45
45
  )
46
46
  else
47
47
  to_send[next_sequence_token_key].push(
48
48
  timestamp: (event.timestamp.time.to_f * 1000).to_int,
49
- message: event.get('message')
49
+ message: encoded
50
50
  )
51
51
  end
52
52
  end
@@ -144,11 +144,20 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
144
144
  @logger.info("Log stream #{send_opts[:log_stream_name]} already exists")
145
145
  end
146
146
  retry
147
- # TODO: handle rejected events with debug message
147
+ rescue Aws::CloudWatchLogs::Errors::InvalidSequenceTokenException => e
148
+ @logger.info(e.code)
149
+ response = @client.describe_log_streams({log_group_name: send_opts[:log_group_name], log_stream_name_prefix: send_opts[:log_stream_name]})
150
+ response.log_streams.each do |stream_data|
151
+ if stream_data.log_stream_name == send_opts[:log_stream_name]
152
+ send_opts[:sequence_token] = stream_data.upload_sequence_token
153
+ break
154
+ end
155
+ end
156
+ retry
148
157
  rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
149
158
  @logger.info('Logs throttling, retry')
150
159
  retry
151
160
  end
152
161
  end
153
- end # def multi_receive_encoded
162
+ end # def multi_receive_encodeds
154
163
  end # class LogStash::Outputs::Awslogs
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-awslogs'
3
- s.version = '0.1.24'
3
+ s.version = '0.1.29'
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'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-awslogs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.1.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Klyba