logstash-output-awslogs 0.1.22 → 0.1.27

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
  SHA256:
3
- metadata.gz: 9584b5be53cc5cd5f7397547f5fa880085c55ab14a37cba3bb16684976ddeda3
4
- data.tar.gz: 88796ea88b9cd8d735cd5f185c0b9c98e4d14ffb3927f6eaf1a6db1d83a3228e
3
+ metadata.gz: b101283f4c71649578a073eac435ecfc727cff3e2cbfea45458e64566b5a42aa
4
+ data.tar.gz: a7ab59be3ca3ca945f52dbb374764c8e869bb724b7e5e8f27c5bf01380a7b708
5
5
  SHA512:
6
- metadata.gz: 93c208b2978085d69009ed77471980b37488a51079c8013582e3a75f46820935965f009388eed5754c5bd496aacceda060c2e8b553f911b2848579c3323ce55c
7
- data.tar.gz: 6738e1b4ee6b31fbe90ede296da1ee55eb0dd1f2205163aed267d0e4ead370ad7e0bc54550bda8b978f4f7f1d3ba63768487c2039af04b059022cf9511679237
6
+ metadata.gz: a44eef076664b96349d4da5d4178e997ba4cd838f11b54d85e000b21c5cdaa02a6543afc9d552c63f12752a55d6666a7b4c36d7c3e671da444908e16088b582a
7
+ data.tar.gz: 1f0d095dd7fe53c97b8d88b0ce80054f7b45c69fcd9abc109332c89b9299881191b0e94a889b0ce32cf86b7d7bed5359092b14bea3154d37ead7667403490ead
@@ -30,7 +30,7 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
30
30
  to_send = {}
31
31
  sequence_tokens = {}
32
32
 
33
- events_and_encoded.each do |event, _encoded|
33
+ events_and_encoded.each do |event, encoded|
34
34
  event_log_stream_name = event.sprintf(log_stream_name)
35
35
  event_log_group_name = event.sprintf(log_group_name)
36
36
 
@@ -38,10 +38,17 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
38
38
  unless to_send.keys.include? next_sequence_token_key
39
39
  to_send.store(next_sequence_token_key, [])
40
40
  end
41
- to_send[next_sequence_token_key].push(
42
- timestamp: (event.timestamp.time.to_f * 1000).to_int,
43
- message: event.get('message')
44
- )
41
+ if event.get('message') && !event.get('message').empty?
42
+ to_send[next_sequence_token_key].push(
43
+ timestamp: (event.timestamp.time.to_f * 1000).to_int,
44
+ message: event.get('message')
45
+ )
46
+ else
47
+ to_send[next_sequence_token_key].push(
48
+ timestamp: (event.timestamp.time.to_f * 1000).to_int,
49
+ message: encoded
50
+ )
51
+ end
45
52
  end
46
53
 
47
54
  group_names = []
@@ -137,11 +144,13 @@ class LogStash::Outputs::Awslogs < LogStash::Outputs::Base
137
144
  @logger.info("Log stream #{send_opts[:log_stream_name]} already exists")
138
145
  end
139
146
  retry
140
- # TODO: handle rejected events with debug message
147
+ rescue Aws::CloudWatchLogs::Errors::InvalidSequenceTokenException => e
148
+ send_opts[:sequence_token] = e[:expected_sequence_token]
149
+ retry
141
150
  rescue Aws::CloudWatchLogs::Errors::ThrottlingException => e
142
151
  @logger.info('Logs throttling, retry')
143
152
  retry
144
153
  end
145
154
  end
146
- end # def multi_receive_encoded
155
+ end # def multi_receive_encodeds
147
156
  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.22'
3
+ s.version = '0.1.27'
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.22
4
+ version: 0.1.27
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-17 00:00:00.000000000 Z
11
+ date: 2020-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement