logstash-output-awslogs 0.1.12 → 0.1.17

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: 777dc69291b2c3a307405c13583b5d3a2de1b2b9
4
- data.tar.gz: 5829780c1044b8ed0461a6159cfaa1b3d3b987e9
3
+ metadata.gz: d401b9bf9bdc4cfbfcbfc67d15149c7808436cd7
4
+ data.tar.gz: 13457ea56d4948e7ba7e3dbffe01cc16054bf538
5
5
  SHA512:
6
- metadata.gz: 4502d60ae7e11290500e1c4ef7ef5557b819bfc9a494f0ec31fdc17b147102cfc90a6633566df3c3fcfb761db0b583b29a667674583d9b1476f1d46abcddc780
7
- data.tar.gz: 736b23303a5673eded828ff4a70bde9eaa3191bea43e7dda6d505f357325baaac6bb05b5db38c4f148a54bf2dc48fd8f24f18080b530feb25d65458287cac6db
6
+ metadata.gz: 2c592f05a971d09885c57092d163a0e05385c933cf74cd9db938f0b5c9a213dce542ed3636e73cd0afdcb4c56c9aa55f5af9415a59f08d075afb202c686f1604
7
+ data.tar.gz: 20736d09febf105024425cf86621948dd9a9d98b97901151f5fa2717e168d9b703a4569deb82d820fc3ef5074ae8b584c4d3e04dec0820d89cdd0eca9ce754a5
@@ -46,12 +46,11 @@ 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
  sequence_tokens[event_log_group_name][log_stream_data.log_stream_name.to_s] = log_stream_data.upload_sequence_token.to_s
57
56
  end
@@ -59,22 +58,13 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
59
58
  rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
60
59
  @logger.info('Will create log group/stream and retry')
61
60
  begin
62
- @client.create_log_group(log_group_name: event_log_group_name)
61
+ @client.create_log_group({log_group_name: event_log_group_name})
63
62
  rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
64
63
  @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
64
  end
75
65
  retry
76
66
  rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
77
- @logger.info('Logs throttling, retry')
67
+ @logger.info('Describe streams throttling, retry')
78
68
  retry
79
69
  end
80
70
  end
@@ -99,51 +89,38 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
99
89
  else
100
90
  begin
101
91
  @client.create_log_stream(ident_opts)
102
- @client.describe_log_streams(log_group_name: event_log_group_name).each do |response|
103
- response.log_streams.each do |log_stream_data|
104
- sequence_tokens[event_log_group_name][log_stream_data.log_stream_name.to_s] = log_stream_data.upload_sequence_token.to_s
105
- end
106
- end
107
- send_opts[:sequence_token] = sequence_tokens[event_log_group_name][event_log_stream_name]
108
92
  rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
109
93
  @logger.info('Will create log group/stream and retry')
110
94
  begin
111
- @client.create_log_group(log_group_name: send_opts[:log_group_name])
95
+ @client.create_log_group({log_group_name: send_opts[:log_group_name]})
112
96
  rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
113
97
  @logger.info("Log group #{send_opts[:log_group_name]} already exists")
114
- rescue Exception => e
115
- @logger.error(e)
116
98
  end
117
99
  begin
118
- @client.create_log_stream(log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name])
100
+ @client.create_log_stream({log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name]})
119
101
  rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
120
102
  @logger.info("Log stream #{send_opts[:log_stream_name]} already exists")
121
- rescue Exception => e
122
- @logger.error(e)
123
103
  end
124
104
  retry
125
105
  rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
126
- @logger.info('Logs throttling, retry')
106
+ @logger.info('Creating log streams throttling, retry')
127
107
  retry
128
108
  end
129
109
  end
130
110
  begin
131
111
  resp = @client.put_log_events(send_opts)
112
+ @next_sequence_tokens.store(next_sequence_token_key, resp.next_sequence_token)
132
113
  rescue Aws::CloudWatchLogs::Errors::ResourceNotFoundException => e
133
114
  @logger.info('Will create log group/stream and retry')
134
115
  begin
135
- @client.create_log_group(log_group_name: send_opts[:log_group_name])
116
+ @client.create_log_group({log_group_name: send_opts[:log_group_name]})
136
117
  rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
137
118
  @logger.info("Log group #{send_opts[:log_group_name]} already exists")
138
- rescue Exception => e
139
- @logger.error(e)
140
119
  end
141
120
  begin
142
- @client.create_log_stream(log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name])
121
+ @client.create_log_stream({log_group_name: send_opts[:log_group_name], log_stream_name: send_opts[:log_stream_name]})
143
122
  rescue Aws::CloudWatchLogs::Errors::ResourceAlreadyExistsException => e
144
123
  @logger.info("Log stream #{send_opts[:log_stream_name]} already exists")
145
- rescue Exception => e
146
- @logger.error(e)
147
124
  end
148
125
  retry
149
126
  # TODO: handle rejected events with debug message
@@ -151,7 +128,6 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
151
128
  @logger.info('Logs throttling, retry')
152
129
  retry
153
130
  end
154
- @next_sequence_tokens.store(next_sequence_token_key, resp.next_sequence_token)
155
131
  end
156
132
  end # def multi_receive_encoded
157
133
  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.12'
3
+ s.version = '0.1.17'
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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-awslogs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Klyba
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-16 00:00:00.000000000 Z
11
+ date: 2020-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core-plugin-api