logstash-output-awslogs 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 99e6b6d40e097febb27b8025eba26a2d9213e251
4
- data.tar.gz: 524e1b29c57f34d41b08b1985260081b31639bec
3
+ metadata.gz: 50f48258fe09e94a5d4cd1d0b80b63d80e2c6924
4
+ data.tar.gz: '019fc72122f4a6f43ef6953db6a18a8e62f35633'
5
5
  SHA512:
6
- metadata.gz: 0a2fc689d1a136b8f77371217414e033abf69fca691d99ce453fe30080ec0d57516d9765dbf2e0de64f856cf55f697819d7b00b35d56435afef6f728fb8163a1
7
- data.tar.gz: 385ea7c63731ebe57a4810429094a576dc0d0328c031c82e183c170791065eaeb3e7d5367f1beabac3c06101ec0082640a2872d45f41166b57b93fcf0e586b97
6
+ metadata.gz: 14588c5507ce952bf9215e1890863bde3639483a39eaca1f1181d5ac0e87ea497c45e555f1ce4ffc1f711f35e243e67ae4ee2e28059f6bc4cea8f25928cea4cc
7
+ data.tar.gz: 12e2d400a0c16c721ad8bbe878cf66e0bec80a74497a21c87c79c8209a73babbaae7217cf94375dab576699e368f1570db1bd2d8dff802366e7b6474c4a98888
@@ -71,9 +71,28 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
71
71
  end
72
72
  end
73
73
 
74
- resp = @client.put_log_events(send_opts)
75
- # TODO: handle rejected events with debug message
76
- @next_sequence_tokens.store(next_sequence_token_key, resp.next_sequence_token)
74
+ begin
75
+ resp = @client.put_log_events(send_opts)
76
+ rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
77
+ @logger.info("Will create log group/stream and retry")
78
+ begin
79
+ @client.create_log_group(:log_group_name => send_opts[:log_group_name])
80
+ rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
81
+ @logger.info("Log group #{send_opts[:log_group_name]} already exists")
82
+ rescue Exception => e
83
+ @logger.error(e)
84
+ end
85
+ begin
86
+ @client.create_log_stream(:log_group_name => send_opts[:log_group_name], :log_stream_name => send_opts[:log_stream_name])
87
+ rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
88
+ @logger.info("Log stream #{send_opts[:log_stream_name]} already exists")
89
+ rescue Exception => e
90
+ @logger.error(e)
91
+ end
92
+ retry
93
+ # TODO: handle rejected events with debug message
94
+ @next_sequence_tokens.store(next_sequence_token_key, resp.next_sequence_token)
95
+ end
77
96
  end
78
97
  end # def multi_receive_encoded
79
98
  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.0'
3
+ s.version = '0.1.1'
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricky Cook