logstash-output-awslogs 0.1.1 → 0.1.2
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 +30 -12
- data/logstash-output-awslogs.gemspec +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b51111e0c86640d2277aa954226775fed704db91
|
4
|
+
data.tar.gz: a24601a758c08e51c1916ffcc6154a878a856916
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cd0ccdb05a9db744383faa4b9985b353f1b20e7cd0f0813bcc12229bd54e8685f58306797bdae3e1f9ec79e450ae66d76a5f47f62a3ced88a55211e88cb3f77
|
7
|
+
data.tar.gz: 5d7eca9d558c504f482e36dff72ca688e8460c38d68e101b9a776afd6be8eddeb62fff27634e3af0862ed9ead45fd089723f87830a55bdf866e0868567e1ffd8
|
@@ -55,22 +55,40 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
|
|
55
55
|
if @next_sequence_tokens.keys.include? next_sequence_token_key
|
56
56
|
send_opts[:sequence_token] = @next_sequence_tokens[next_sequence_token_key]
|
57
57
|
else
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
58
|
+
begin
|
59
|
+
resp = @client.describe_log_streams({
|
60
|
+
log_group_name: event_log_group_name,
|
61
|
+
log_stream_name_prefix: event_log_stream_name,
|
62
|
+
})
|
63
|
+
if resp.log_streams.length < 1
|
64
|
+
@client.create_log_stream(ident_opts)
|
65
|
+
else
|
66
|
+
resp.log_streams.each do |log_stream_data|
|
67
|
+
if log_stream_data.log_stream_name == event_log_stream_name
|
68
|
+
send_opts[:sequence_token] = log_stream_data.upload_sequence_token
|
69
|
+
break
|
70
|
+
end
|
69
71
|
end
|
70
72
|
end
|
73
|
+
rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
|
74
|
+
@logger.info("Will create log group/stream and retry")
|
75
|
+
begin
|
76
|
+
@client.create_log_group(:log_group_name => send_opts[:log_group_name])
|
77
|
+
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
78
|
+
@logger.info("Log group #{send_opts[:log_group_name]} already exists")
|
79
|
+
rescue Exception => e
|
80
|
+
@logger.error(e)
|
81
|
+
end
|
82
|
+
begin
|
83
|
+
@client.create_log_stream(:log_group_name => send_opts[:log_group_name], :log_stream_name => send_opts[:log_stream_name])
|
84
|
+
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
85
|
+
@logger.info("Log stream #{send_opts[:log_stream_name]} already exists")
|
86
|
+
rescue Exception => e
|
87
|
+
@logger.error(e)
|
88
|
+
end
|
89
|
+
retry
|
71
90
|
end
|
72
91
|
end
|
73
|
-
|
74
92
|
begin
|
75
93
|
resp = @client.put_log_events(send_opts)
|
76
94
|
rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
|
@@ -1,11 +1,11 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-awslogs'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.2'
|
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'
|
7
|
-
s.authors = ['
|
8
|
-
s.email = '
|
7
|
+
s.authors = ['Anton Klyba']
|
8
|
+
s.email = 'anarhyst266+gems@gmail.com'
|
9
9
|
s.require_paths = ['lib']
|
10
10
|
|
11
11
|
# Files
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Anton Klyba
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description:
|
70
|
-
email:
|
70
|
+
email: anarhyst266+gems@gmail.com
|
71
71
|
executables: []
|
72
72
|
extensions: []
|
73
73
|
extra_rdoc_files: []
|