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 +4 -4
- data/lib/logstash/outputs/awslogs.rb +14 -5
- data/logstash-output-awslogs.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6d187d9a46e3d3b58b9cc7782499de7de990eca4eb2ba212b03abe8ff29d42e
|
4
|
+
data.tar.gz: 217c5ae517cfc1333ec150499be174543087a9063374a1a65ae66fcc3525f909
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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')
|
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:
|
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:
|
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
|
-
|
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
|
162
|
+
end # def multi_receive_encodeds
|
154
163
|
end # class LogStash::Outputs::Awslogs
|