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 +4 -4
- data/lib/logstash/outputs/awslogs.rb +22 -3
- data/logstash-output-awslogs.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50f48258fe09e94a5d4cd1d0b80b63d80e2c6924
|
4
|
+
data.tar.gz: '019fc72122f4a6f43ef6953db6a18a8e62f35633'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
75
|
-
|
76
|
-
|
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
|