logstash-output-awslogs 0.1.16 → 0.1.21
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 +25 -26
- 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: 583b99ac1c82f6ce8a4062c69e3c5573ee4423c367a50c17ab22f74a7c0a5f94
|
4
|
+
data.tar.gz: 77dc1748568954518bc4086b5fa4d9b9f30060d2741a4cab129c63485083a3f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d06f504f05c63fbf005395730b2a00c87b82a68c904875997bda8ddfa4ec669ec4a4acc6eae864c64ca4e49cd56d477c1c119f574d4bec3f06a7ee6bd05abfd1
|
7
|
+
data.tar.gz: 801d5a4a3b8c20edd00f5e7d356f7ac2a0fcafa38a055919ef92f8665d7067dce8ed6e0a1074fe16539770ea8b9ffce7a83538e27a5171e9cff2418a206e4079
|
data/Gemfile
CHANGED
@@ -44,29 +44,36 @@ 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
|
-
|
50
|
+
unless group_names.include? event_log_group_name
|
51
|
+
group_names.push(event_log_group_name)
|
52
|
+
end
|
53
|
+
end
|
50
54
|
|
51
|
-
|
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:
|
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?
|
63
|
+
sequence_tokens[log_group_name][log_stream_data.log_stream_name.to_s] = log_stream_data.upload_sequence_token.to_s
|
64
|
+
end
|
56
65
|
end
|
57
66
|
end
|
58
67
|
rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
|
59
|
-
@logger.info(
|
68
|
+
@logger.info("Will create log group #{log_group_name} and retry")
|
60
69
|
begin
|
61
|
-
@client.create_log_group(log_group_name:
|
70
|
+
@client.create_log_group({log_group_name: log_group_name})
|
62
71
|
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
63
|
-
@logger.info("Log group #{
|
64
|
-
rescue Exception => e
|
65
|
-
@logger.error(e)
|
72
|
+
@logger.info("Log group #{log_group_name} already exists")
|
66
73
|
end
|
67
74
|
retry
|
68
75
|
rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
|
69
|
-
@logger.info('
|
76
|
+
@logger.info('Describe streams throttling, retry')
|
70
77
|
retry
|
71
78
|
end
|
72
79
|
end
|
@@ -86,7 +93,7 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
|
|
86
93
|
|
87
94
|
if @next_sequence_tokens.keys.include? next_sequence_token_key
|
88
95
|
send_opts[:sequence_token] = @next_sequence_tokens[next_sequence_token_key]
|
89
|
-
elsif sequence_tokens[event_log_group_name]
|
96
|
+
elsif !sequence_tokens[event_log_group_name][event_log_stream_name]&.empty?
|
90
97
|
send_opts[:sequence_token] = sequence_tokens[event_log_group_name][event_log_stream_name]
|
91
98
|
else
|
92
99
|
begin
|
@@ -94,23 +101,21 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
|
|
94
101
|
rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
|
95
102
|
@logger.info('Will create log group/stream and retry')
|
96
103
|
begin
|
97
|
-
@client.create_log_group(log_group_name: send_opts[:log_group_name])
|
104
|
+
@client.create_log_group({log_group_name: send_opts[:log_group_name]})
|
98
105
|
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
99
106
|
@logger.info("Log group #{send_opts[:log_group_name]} already exists")
|
100
|
-
rescue Exception => e
|
101
|
-
@logger.error(e)
|
102
107
|
end
|
103
108
|
begin
|
104
|
-
@client.create_log_stream(log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name])
|
109
|
+
@client.create_log_stream({log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name]})
|
105
110
|
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
106
111
|
@logger.info("Log stream #{send_opts[:log_stream_name]} already exists")
|
107
|
-
rescue Exception => e
|
108
|
-
@logger.error(e)
|
109
112
|
end
|
110
113
|
retry
|
111
114
|
rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
|
112
|
-
@logger.info('
|
115
|
+
@logger.info('Creating log streams throttling, retry')
|
113
116
|
retry
|
117
|
+
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
118
|
+
@logger.info("Log stream #{send_opts[:log_stream_name]} already exists")
|
114
119
|
end
|
115
120
|
end
|
116
121
|
begin
|
@@ -119,26 +124,20 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
|
|
119
124
|
rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
|
120
125
|
@logger.info('Will create log group/stream and retry')
|
121
126
|
begin
|
122
|
-
@client.create_log_group(log_group_name: send_opts[:log_group_name])
|
127
|
+
@client.create_log_group({log_group_name: send_opts[:log_group_name]})
|
123
128
|
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
124
129
|
@logger.info("Log group #{send_opts[:log_group_name]} already exists")
|
125
|
-
rescue Exception => e
|
126
|
-
@logger.error(e)
|
127
130
|
end
|
128
131
|
begin
|
129
|
-
@client.create_log_stream(log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name])
|
132
|
+
@client.create_log_stream({log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name]})
|
130
133
|
rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
|
131
134
|
@logger.info("Log stream #{send_opts[:log_stream_name]} already exists")
|
132
|
-
rescue Exception => e
|
133
|
-
@logger.error(e)
|
134
135
|
end
|
135
136
|
retry
|
136
137
|
# TODO: handle rejected events with debug message
|
137
138
|
rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
|
138
139
|
@logger.info('Logs throttling, retry')
|
139
140
|
retry
|
140
|
-
rescue Exception => e
|
141
|
-
@logger.error(e)
|
142
141
|
end
|
143
142
|
end
|
144
143
|
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.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'
|
@@ -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.21
|
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: []
|