logstash-output-azure_service_bus 0.3.1 → 0.3.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3ec4e870e1468a85580e2818896b9469a4113e8f6a021b1dd2b3e499b81a624
|
4
|
+
data.tar.gz: 158011583fa027e9976596ce9704c82e30c2507e7a65bd806e5cea7052589103
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e407a73289679319f6a96c26915f144a1288a0ed09340dc76c9393d57b692eea419024ceec76ad65418171634e1828344a4d4108d0da2be0a1ddbe9a9833ead
|
7
|
+
data.tar.gz: df7845a5345202913517bc10ddc1233d4b7887a66ad074bf909aab6b70ec51d7527b69391067017f48976bb6016e90bb88703402ec4268da13617ae34afcbdca
|
@@ -26,10 +26,13 @@ class LogStash::Outputs::AzureServiceBus < LogStash::Outputs::Base
|
|
26
26
|
@logger.warn("Problem (#{exception}) for #{env.method.upcase} #{env.url}")
|
27
27
|
else
|
28
28
|
@logger.warn("Problem (HTTP #{env.status}) for #{env.method.upcase} #{env.url}")
|
29
|
+
if env.status == 401
|
30
|
+
refresh_access_token
|
31
|
+
env.request_headers['Authorization'] = "Bearer #{@access_token}"
|
32
|
+
end
|
29
33
|
end
|
30
34
|
end,
|
31
|
-
retry_if: lambda do |
|
32
|
-
refresh_access_token if env.status == 401
|
35
|
+
retry_if: lambda do |_env, _exc|
|
33
36
|
true # Always retry
|
34
37
|
end
|
35
38
|
}
|
@@ -70,7 +73,7 @@ class LogStash::Outputs::AzureServiceBus < LogStash::Outputs::Base
|
|
70
73
|
# Hopefully we never make it here and "throw away" messages since we have an agressive retry strategy.
|
71
74
|
@logger.error("Error (#{e}) while sending message to Service Bus")
|
72
75
|
else
|
73
|
-
if response.status ==
|
76
|
+
if response.status == 201
|
74
77
|
@logger.debug("Sent #{messages.length} message(s) to Service Bus")
|
75
78
|
else
|
76
79
|
@logger.error("Error while sending message to Service Bus: HTTP #{response.status}")
|
@@ -78,11 +81,11 @@ class LogStash::Outputs::AzureServiceBus < LogStash::Outputs::Base
|
|
78
81
|
end
|
79
82
|
|
80
83
|
def refresh_access_token
|
81
|
-
@logger.info('Refreshing Azure access token')
|
84
|
+
@logger.info('Refreshing Azure access token...')
|
82
85
|
begin
|
83
|
-
response = Faraday.get('http://169.254.169.254/metadata/identity/oauth2/token',
|
86
|
+
response = Faraday.get('http://169.254.169.254/metadata/identity/oauth2/token', { 'api-version' => '2018-02-01', 'resource' => 'https://servicebus.azure.net/' }) do |req|
|
84
87
|
req.headers = { 'Metadata' => 'true' }
|
85
|
-
req.options.timeout =
|
88
|
+
req.options.timeout = 10
|
86
89
|
end
|
87
90
|
rescue StandardError => e # We just catch everything and move on since @service_bus_conn will handle retries.
|
88
91
|
@logger.error("Error while fetching access token: #{e}")
|
@@ -90,6 +93,7 @@ class LogStash::Outputs::AzureServiceBus < LogStash::Outputs::Base
|
|
90
93
|
if response.status == 200
|
91
94
|
data = JSON.parse(response.body)
|
92
95
|
@access_token = data['access_token']
|
96
|
+
@logger.info('Successfully refreshed Azure access token')
|
93
97
|
else
|
94
98
|
@logger.error("HTTP error when fetching access token: #{response.body}")
|
95
99
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-azure_service_bus'
|
3
|
-
s.version = '0.3.
|
3
|
+
s.version = '0.3.4'
|
4
4
|
s.licenses = ['Apache-2.0']
|
5
5
|
s.summary = 'Send Logstash messages to Azure Service Bus.'
|
6
6
|
s.homepage = 'https://github.com/gharryg/logstash-output-azure_service_bus'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-azure_service_bus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harrison Golden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|