logstash-output-awslogs 0.1.20 → 0.1.21
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 -7
- 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: 583b99ac1c82f6ce8a4062c69e3c5573ee4423c367a50c17ab22f74a7c0a5f94
|
4
|
+
data.tar.gz: 77dc1748568954518bc4086b5fa4d9b9f30060d2741a4cab129c63485083a3f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d06f504f05c63fbf005395730b2a00c87b82a68c904875997bda8ddfa4ec669ec4a4acc6eae864c64ca4e49cd56d477c1c119f574d4bec3f06a7ee6bd05abfd1
|
7
|
+
data.tar.gz: 801d5a4a3b8c20edd00f5e7d356f7ac2a0fcafa38a055919ef92f8665d7067dce8ed6e0a1074fe16539770ea8b9ffce7a83538e27a5171e9cff2418a206e4079
|
@@ -44,25 +44,32 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
|
|
44
44
|
)
|
45
45
|
end
|
46
46
|
|
47
|
+
group_names = []
|
47
48
|
to_send.each do |event_log_names, _events|
|
48
49
|
event_log_group_name = event_log_names[0]
|
49
|
-
|
50
|
+
unless group_names.include? event_log_group_name
|
51
|
+
group_names.push(event_log_group_name)
|
52
|
+
end
|
53
|
+
end
|
50
54
|
|
51
|
-
|
55
|
+
group_names.each do |log_group_name|
|
56
|
+
unless sequence_tokens.keys.include? log_group_name
|
57
|
+
sequence_tokens.store(log_group_name, {})
|
58
|
+
end
|
52
59
|
begin
|
53
|
-
@client.describe_log_streams({log_group_name:
|
60
|
+
@client.describe_log_streams({log_group_name: log_group_name}).each do |response|
|
54
61
|
response.log_streams.each do |log_stream_data|
|
55
62
|
unless log_stream_data.upload_sequence_token&.empty?
|
56
|
-
sequence_tokens[
|
63
|
+
sequence_tokens[log_group_name][log_stream_data.log_stream_name.to_s] = log_stream_data.upload_sequence_token.to_s
|
57
64
|
end
|
58
65
|
end
|
59
66
|
end
|
60
67
|
rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
|
61
|
-
@logger.info(
|
68
|
+
@logger.info("Will create log group #{log_group_name} and retry")
|
62
69
|
begin
|
63
|
-
@client.create_log_group({log_group_name:
|
70
|
+
@client.create_log_group({log_group_name: log_group_name})
|
64
71
|
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
65
|
-
@logger.info("Log group #{
|
72
|
+
@logger.info("Log group #{log_group_name} already exists")
|
66
73
|
end
|
67
74
|
retry
|
68
75
|
rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
|