logstash-output-awslogs 0.1.21 → 0.1.26
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 +18 -5
- data/logstash-output-awslogs.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 268bd7af65517b4eab80732976110a10662de589fd07108448e1be71b33adfe7
|
4
|
+
data.tar.gz: f0861dffc5571fd36deff09aca9f27abc09201be1df7e83582360f54e4a8e0db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41cd461560ed5d827b61e4e560c08754a07255f829805eed9ec36e6a8c669b5eba974c616919d6f8b96093ce3b5f534bd23a1dd81b7a64aa3363d4098534652a
|
7
|
+
data.tar.gz: d2388be26aa0bcb7876f88e4fd4e5ae8c67f1cc91d70e0fa0092caecc73674c3370e996b79ad3c6b0d34bd9b786d8ceabbbc20cb9a5d1a0cfbf5fd3f2b83f5a9
|
@@ -30,7 +30,7 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
|
|
30
30
|
to_send = {}
|
31
31
|
sequence_tokens = {}
|
32
32
|
|
33
|
-
events_and_encoded.each do |event,
|
33
|
+
events_and_encoded.each do |event, encoded|
|
34
34
|
event_log_stream_name = event.sprintf(log_stream_name)
|
35
35
|
event_log_group_name = event.sprintf(log_group_name)
|
36
36
|
|
@@ -38,15 +38,25 @@ 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
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
if event.get('message') && !event.get('message').empty?
|
42
|
+
to_send[next_sequence_token_key].push(
|
43
|
+
timestamp: (event.timestamp.time.to_f * 1000).to_int,
|
44
|
+
message: event.get('message')
|
45
|
+
)
|
46
|
+
else
|
47
|
+
to_send[next_sequence_token_key].push(
|
48
|
+
timestamp: (event.timestamp.time.to_f * 1000).to_int,
|
49
|
+
message: encoded
|
50
|
+
)
|
51
|
+
end
|
45
52
|
end
|
46
53
|
|
47
54
|
group_names = []
|
48
55
|
to_send.each do |event_log_names, _events|
|
49
56
|
event_log_group_name = event_log_names[0]
|
57
|
+
event_log_stream_name = event_log_names[1]
|
58
|
+
next_sequence_token_key = [event_log_group_name, event_log_stream_name]
|
59
|
+
next if @next_sequence_tokens.keys.include? next_sequence_token_key
|
50
60
|
unless group_names.include? event_log_group_name
|
51
61
|
group_names.push(event_log_group_name)
|
52
62
|
end
|
@@ -135,6 +145,9 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
|
|
135
145
|
end
|
136
146
|
retry
|
137
147
|
# TODO: handle rejected events with debug message
|
148
|
+
rescue Aws::CloudWatchLogs::Errors::InvalidSequenceTokenException => e
|
149
|
+
send_opts[:sequence_token] = e.expected_sequence_token
|
150
|
+
retry
|
138
151
|
rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
|
139
152
|
@logger.info('Logs throttling, retry')
|
140
153
|
retry
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-awslogs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Klyba
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|