logstash-output-awslogs 0.1.14 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +1 -2
- data/lib/logstash/outputs/awslogs.rb +12 -38
- data/logstash-output-awslogs.gemspec +2 -1
- metadata +28 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f22136ec202151e2601a9c93299d84797c1f16930c9236a495feabaf81f6444a
|
4
|
+
data.tar.gz: 9f7c115e01fd43e940a510e026157b40d051d2d7d246e783ae4107a6fba73b0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a30e56087c9ec65e1acb13dba932515e558e7fbccdc6b780d3963ee9b5ad79afcc31832fe57386402da6eef09e4cf4ac3647ba6524d16c6cdab216c7ecca93f2
|
7
|
+
data.tar.gz: 128aa9961f0ad5ec991243bc9442008ca05a1ee2b54466cc85edea0dafb75f5bb7db0646e0c36299766a875a607dd367429455c0787dbd992be1c20032d9fa39
|
data/Gemfile
CHANGED
@@ -46,35 +46,27 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
|
|
46
46
|
|
47
47
|
to_send.each do |event_log_names, _events|
|
48
48
|
event_log_group_name = event_log_names[0]
|
49
|
-
event_log_stream_name = event_log_names[1]
|
50
49
|
next if sequence_tokens.keys.include? event_log_group_name
|
51
50
|
|
52
51
|
sequence_tokens.store(event_log_group_name, {})
|
53
52
|
begin
|
54
|
-
@client.describe_log_streams(log_group_name: event_log_group_name).each do |response|
|
53
|
+
@client.describe_log_streams({log_group_name: event_log_group_name}).each do |response|
|
55
54
|
response.log_streams.each do |log_stream_data|
|
56
|
-
|
55
|
+
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
|
57
|
+
end
|
57
58
|
end
|
58
59
|
end
|
59
60
|
rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
|
60
61
|
@logger.info('Will create log group/stream and retry')
|
61
62
|
begin
|
62
|
-
@client.create_log_group(log_group_name: event_log_group_name)
|
63
|
+
@client.create_log_group({log_group_name: event_log_group_name})
|
63
64
|
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
64
65
|
@logger.info("Log group #{event_log_group_name} already exists")
|
65
|
-
rescue Exception => e
|
66
|
-
@logger.error(e)
|
67
|
-
end
|
68
|
-
begin
|
69
|
-
@client.create_log_stream(log_group_name: event_log_group_name, log_stream_name: event_log_stream_name)
|
70
|
-
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
71
|
-
@logger.info("Log stream #{event_log_stream_name} already exists")
|
72
|
-
rescue Exception => e
|
73
|
-
@logger.error(e)
|
74
66
|
end
|
75
67
|
retry
|
76
68
|
rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
|
77
|
-
@logger.info('
|
69
|
+
@logger.info('Describe streams throttling, retry')
|
78
70
|
retry
|
79
71
|
end
|
80
72
|
end
|
@@ -94,38 +86,26 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
|
|
94
86
|
|
95
87
|
if @next_sequence_tokens.keys.include? next_sequence_token_key
|
96
88
|
send_opts[:sequence_token] = @next_sequence_tokens[next_sequence_token_key]
|
97
|
-
elsif sequence_tokens[event_log_group_name]
|
89
|
+
elsif !sequence_tokens[event_log_group_name][event_log_stream_name]&.empty?
|
98
90
|
send_opts[:sequence_token] = sequence_tokens[event_log_group_name][event_log_stream_name]
|
99
91
|
else
|
100
92
|
begin
|
101
93
|
@client.create_log_stream(ident_opts)
|
102
|
-
until sequence_tokens[event_log_group_name][event_log_stream_name] do
|
103
|
-
@client.describe_log_streams(log_group_name: event_log_group_name).each do |response|
|
104
|
-
response.log_streams.each do |log_stream_data|
|
105
|
-
sequence_tokens[event_log_group_name][log_stream_data.log_stream_name.to_s] = log_stream_data.upload_sequence_token.to_s
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
109
|
-
send_opts[:sequence_token] = sequence_tokens[event_log_group_name][event_log_stream_name]
|
110
94
|
rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
|
111
95
|
@logger.info('Will create log group/stream and retry')
|
112
96
|
begin
|
113
|
-
@client.create_log_group(log_group_name: send_opts[:log_group_name])
|
97
|
+
@client.create_log_group({log_group_name: send_opts[:log_group_name]})
|
114
98
|
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
115
99
|
@logger.info("Log group #{send_opts[:log_group_name]} already exists")
|
116
|
-
rescue Exception => e
|
117
|
-
@logger.error(e)
|
118
100
|
end
|
119
101
|
begin
|
120
|
-
@client.create_log_stream(log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name])
|
102
|
+
@client.create_log_stream({log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name]})
|
121
103
|
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
122
104
|
@logger.info("Log stream #{send_opts[:log_stream_name]} already exists")
|
123
|
-
rescue Exception => e
|
124
|
-
@logger.error(e)
|
125
105
|
end
|
126
106
|
retry
|
127
107
|
rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
|
128
|
-
@logger.info('
|
108
|
+
@logger.info('Creating log streams throttling, retry')
|
129
109
|
retry
|
130
110
|
end
|
131
111
|
end
|
@@ -135,26 +115,20 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
|
|
135
115
|
rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
|
136
116
|
@logger.info('Will create log group/stream and retry')
|
137
117
|
begin
|
138
|
-
@client.create_log_group(log_group_name: send_opts[:log_group_name])
|
118
|
+
@client.create_log_group({log_group_name: send_opts[:log_group_name]})
|
139
119
|
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
140
120
|
@logger.info("Log group #{send_opts[:log_group_name]} already exists")
|
141
|
-
rescue Exception => e
|
142
|
-
@logger.error(e)
|
143
121
|
end
|
144
122
|
begin
|
145
|
-
@client.create_log_stream(log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name])
|
123
|
+
@client.create_log_stream({log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name]})
|
146
124
|
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
147
125
|
@logger.info("Log stream #{send_opts[:log_stream_name]} already exists")
|
148
|
-
rescue Exception => e
|
149
|
-
@logger.error(e)
|
150
126
|
end
|
151
127
|
retry
|
152
128
|
# TODO: handle rejected events with debug message
|
153
129
|
rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
|
154
130
|
@logger.info('Logs throttling, retry')
|
155
131
|
retry
|
156
|
-
rescue Exception => e
|
157
|
-
@logger.error("Err: #{e}; Opts: #{send_opts.each { |k,v| "#{k.to_s} : #{v.to_s}" }}")
|
158
132
|
end
|
159
133
|
end
|
160
134
|
end # def multi_receive_encoded
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-awslogs'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.19'
|
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'
|
@@ -21,4 +21,5 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_runtime_dependency "logstash-codec-plain"
|
22
22
|
s.add_runtime_dependency 'logstash-mixin-aws', '>= 4.3.0'
|
23
23
|
s.add_development_dependency "logstash-devutils"
|
24
|
+
s.add_development_dependency "aws-sdk-cloudwatchlogs"
|
24
25
|
end
|
metadata
CHANGED
@@ -1,72 +1,86 @@
|
|
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.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Klyba
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2020-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: logstash-core-plugin-api
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
16
|
- - "~>"
|
18
17
|
- !ruby/object:Gem::Version
|
19
18
|
version: '2.0'
|
20
|
-
|
19
|
+
name: logstash-core-plugin-api
|
21
20
|
prerelease: false
|
21
|
+
type: :runtime
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: logstash-codec-plain
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - ">="
|
32
31
|
- !ruby/object:Gem::Version
|
33
32
|
version: '0'
|
34
|
-
|
33
|
+
name: logstash-codec-plain
|
35
34
|
prerelease: false
|
35
|
+
type: :runtime
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: logstash-mixin-aws
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
44
|
- - ">="
|
46
45
|
- !ruby/object:Gem::Version
|
47
46
|
version: 4.3.0
|
48
|
-
|
47
|
+
name: logstash-mixin-aws
|
49
48
|
prerelease: false
|
49
|
+
type: :runtime
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 4.3.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name: logstash-devutils
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
58
|
- - ">="
|
60
59
|
- !ruby/object:Gem::Version
|
61
60
|
version: '0'
|
61
|
+
name: logstash-devutils
|
62
|
+
prerelease: false
|
62
63
|
type: :development
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
name: aws-sdk-cloudwatchlogs
|
63
76
|
prerelease: false
|
77
|
+
type: :development
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
69
|
-
description:
|
83
|
+
description:
|
70
84
|
email: anarhyst266+gems@gmail.com
|
71
85
|
executables: []
|
72
86
|
extensions: []
|
@@ -86,7 +100,7 @@ licenses:
|
|
86
100
|
metadata:
|
87
101
|
logstash_plugin: 'true'
|
88
102
|
logstash_group: output
|
89
|
-
post_install_message:
|
103
|
+
post_install_message:
|
90
104
|
rdoc_options: []
|
91
105
|
require_paths:
|
92
106
|
- lib
|
@@ -101,9 +115,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
115
|
- !ruby/object:Gem::Version
|
102
116
|
version: '0'
|
103
117
|
requirements: []
|
104
|
-
rubyforge_project:
|
105
|
-
rubygems_version: 2.
|
106
|
-
signing_key:
|
118
|
+
rubyforge_project:
|
119
|
+
rubygems_version: 2.6.11
|
120
|
+
signing_key:
|
107
121
|
specification_version: 4
|
108
122
|
summary: Writes events to AWS CloudWatch logs.
|
109
123
|
test_files: []
|