logstash-output-azure_service_bus 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -3
- data/lib/logstash/outputs/azure_service_bus.rb +10 -6
- data/logstash-output-azure_service_bus.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d92fdd5d7f0480de294337224352219cbf9d3d716f52af0ab4e80ce9a15cda76
|
4
|
+
data.tar.gz: f71204c35cdb3ec8d8366e21c2a6704e267d2385084e40e55786f3159bb885f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb50873e64d439fc6114e748c9fd86c53b70b6d7ca3ca3eb271c71950941ccaa92fc2927259e8143c2349bd32b2f56313ec1a257dc3bfc01a07afcfc55375efb
|
7
|
+
data.tar.gz: 5fd4b7d91de58c9e439cbf39f4d935a6f688b149ace2b0135743f3a1ed6684951828689066a73f447fa8a15f928cdd3c0affa1b02e9a5f5920b31edf9f6dd0e5
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ This plugin is hosted on RubyGems.org: [https://rubygems.org/gems/logstash-outpu
|
|
7
7
|
## Install
|
8
8
|
To install, use the plugin tool that is part of your Logstash installation:
|
9
9
|
```
|
10
|
-
$
|
10
|
+
$LOGSTASH_PATH/bin/logstash-plugin install logstash-output-azure_service_bus
|
11
11
|
```
|
12
12
|
|
13
13
|
## Pipeline Configuration
|
@@ -27,14 +27,18 @@ There is one optional setting (`messageid_field`) which sets the Service Bus `Me
|
|
27
27
|
input { ... }
|
28
28
|
filter {
|
29
29
|
uuid {
|
30
|
-
target => "uuid"
|
30
|
+
target => "[@metadata][uuid]"
|
31
31
|
}
|
32
32
|
}
|
33
33
|
output {
|
34
34
|
azure_service_bus {
|
35
35
|
service_bus_namespace => "service-bus-name"
|
36
36
|
service_bus_entity => "queue-or-topic-name"
|
37
|
-
messageid_field => "uuid"
|
37
|
+
messageid_field => "[@metadata][uuid]"
|
38
|
+
}
|
39
|
+
elasticsearch {
|
40
|
+
...
|
41
|
+
document_id => "%{[@metadata][uuid]}"
|
38
42
|
}
|
39
43
|
}
|
40
44
|
```
|
@@ -14,14 +14,14 @@ class LogStash::Outputs::AzureServiceBus < LogStash::Outputs::Base
|
|
14
14
|
|
15
15
|
def register
|
16
16
|
retry_options = {
|
17
|
-
max:
|
17
|
+
max: 5,
|
18
18
|
interval: 1,
|
19
19
|
interval_randomness: 0.5,
|
20
20
|
backoff_factor: 2,
|
21
21
|
retry_statuses: [429, 500],
|
22
22
|
exceptions: [Faraday::ConnectionFailed, Faraday::TimeoutError, Faraday::RetriableResponse],
|
23
23
|
methods: %i[get post],
|
24
|
-
retry_block: ->(env, _options, retries, exception) { @logger.warn("
|
24
|
+
retry_block: ->(env, _options, retries, exception) { @logger.warn("Problem (#{exception}) for #{env.method.upcase} #{env.url} - #{retries + 1} retry(s) left") }
|
25
25
|
}
|
26
26
|
@token_conn = Faraday.new(
|
27
27
|
url: 'http://169.254.169.254/metadata/identity/oauth2/token',
|
@@ -60,11 +60,15 @@ class LogStash::Outputs::AzureServiceBus < LogStash::Outputs::Base
|
|
60
60
|
|
61
61
|
def post_messages(messages)
|
62
62
|
refresh_access_token if access_token_needs_refresh?
|
63
|
-
|
64
|
-
|
65
|
-
|
63
|
+
begin
|
64
|
+
response = @service_bus_conn.post('messages') do |req|
|
65
|
+
req.body = JSON.generate(messages)
|
66
|
+
req.headers = { 'Authorization' => "Bearer #{@access_token}", 'Content-Type' => 'application/vnd.microsoft.servicebus.json' }
|
67
|
+
end
|
68
|
+
rescue StandardError => e
|
69
|
+
@logger.error("Error (#{e}) while sending message to Service Bus")
|
66
70
|
end
|
67
|
-
|
71
|
+
@logger.error("HTTP error while sending message to Service Bus: HTTP #{response.status}") if response.status != 201
|
68
72
|
|
69
73
|
@logger.debug("Sent #{messages.length} message(s) to Service Bus")
|
70
74
|
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.2.
|
3
|
+
s.version = '0.2.2'
|
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.2.
|
4
|
+
version: 0.2.2
|
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-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|