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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a17afa9328ef3d785b0ff6cbd00b60db09fa3f64f8dec15c93b587b00ff8bad7
4
- data.tar.gz: e343fe4e97dfe5ea2dbd7c4949be7e8d5b59a6880249c7a21fa8f3409aadfbc7
3
+ metadata.gz: 583b99ac1c82f6ce8a4062c69e3c5573ee4423c367a50c17ab22f74a7c0a5f94
4
+ data.tar.gz: 77dc1748568954518bc4086b5fa4d9b9f30060d2741a4cab129c63485083a3f7
5
5
  SHA512:
6
- metadata.gz: 64487c9cb52c41e5ca319f1fac727ebda10c30118d6ba6009db4b3f33d1ace0965e669c5d7080d978d5a63f1682ebdec04362def17749b6d3c4549f3af58dd89
7
- data.tar.gz: f377fb99c2c526528d64298ce7841f9b84d8c6df1a30b4f8b7534dd65861b57e944f8ff66f9bb56f9e9198cc015ee988f7183581862816146cc73f343801e8c1
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
- next if sequence_tokens.keys.include? event_log_group_name
50
+ unless group_names.include? event_log_group_name
51
+ group_names.push(event_log_group_name)
52
+ end
53
+ end
50
54
 
51
- sequence_tokens.store(event_log_group_name, {})
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: event_log_group_name}).each do |response|
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[event_log_group_name][log_stream_data.log_stream_name.to_s] = log_stream_data.upload_sequence_token.to_s
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('Will create log group/stream and retry')
68
+ @logger.info("Will create log group #{log_group_name} and retry")
62
69
  begin
63
- @client.create_log_group({log_group_name: event_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 #{event_log_group_name} already exists")
72
+ @logger.info("Log group #{log_group_name} already exists")
66
73
  end
67
74
  retry
68
75
  rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-awslogs'
3
- s.version = '0.1.20'
3
+ s.version = '0.1.21'
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.20
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Klyba