logstash-output-azure_service_bus 0.1.6 → 0.2.0

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: 86afcaf954af103be089a59d6fecb8f6fe4f2d69b5190f7ffd6ad33648a46054
4
- data.tar.gz: 29e8e7fa58b69b713df750609609a96e4a4f0d2000f37362cae92d20a36104ad
3
+ metadata.gz: 016441e1bf597f2bdea94a9123cf4a5fb10541ee6181455bb070a623cd0d1b74
4
+ data.tar.gz: 872320c9b33b392745ddd08781bbd3f6bb14516150808d9f79079ead73bd5fea
5
5
  SHA512:
6
- metadata.gz: 242299e9ab1b5bc4ca4adb3af61976d05fe5216331a82b91dad00e19099187faeb0b90daa870b987a404ddbc50af18c13c44344a7adea648f83d967dd1431d64
7
- data.tar.gz: 31fca87e475ae0e52ff5654f88b59f9a5efa84c739425938c853b4691f50b3ed241306bb7ec249f1e240571b55293a2fd7ee40301043f01d807b112a16057961
6
+ metadata.gz: a69069641020d293436f0a6b9bb633734b030fc16731a006ab54deabc5e42958fbcae23c13aa370c200b51fbb8af7fe7c47f98256a9bb051fbf07a7438cd724a
7
+ data.tar.gz: 9ced162d4a22745c9507c2e38800f493a04f9cb938d63ba3fcde836d5d997f9774f3eeaa28caf7c38f4fb11c22a8f15a77ae8be73d54feecf5928bd778afa43c
@@ -10,6 +10,7 @@ class LogStash::Outputs::AzureServiceBus < LogStash::Outputs::Base
10
10
 
11
11
  config :service_bus_namespace, :validate => :string, :required => true
12
12
  config :service_bus_entity, :validate => :string, :required => true
13
+ config :uuid_field, :validate => :string
13
14
 
14
15
  def register
15
16
  retry_options = {
@@ -20,13 +21,13 @@ class LogStash::Outputs::AzureServiceBus < LogStash::Outputs::Base
20
21
  retry_statuses: [429, 500],
21
22
  exceptions: [Faraday::ConnectionFailed, Faraday::TimeoutError, Faraday::RetriableResponse],
22
23
  methods: %i[get post],
23
- retry_block: ->(env, _options, retries, exception) { @logger.error("Error (#{exception}) for #{env.method.upcase} #{env.url} - #{retries + 1} retry(s) left") }
24
+ retry_block: ->(env, _options, retries, exception) { @logger.warn("Error (#{exception}) for #{env.method.upcase} #{env.url} - #{retries + 1} retry(s) left") }
24
25
  }
25
26
  @token_conn = Faraday.new(
26
27
  url: 'http://169.254.169.254/metadata/identity/oauth2/token',
27
28
  params: { 'api-version' => '2018-02-01', 'resource' => 'https://servicebus.azure.net/' },
28
29
  headers: { 'Metadata' => 'true' },
29
- request: { timeout: 1 }
30
+ request: { timeout: 4 }
30
31
  ) do |f|
31
32
  f.request :retry, retry_options
32
33
  end
@@ -48,7 +49,11 @@ class LogStash::Outputs::AzureServiceBus < LogStash::Outputs::Base
48
49
  def send_events(events)
49
50
  messages = []
50
51
  events.each do |event|
51
- messages.append({ 'Body' => JSON.generate(event.to_hash), 'BrokerProperties' => { 'ContentType' => 'application/json' } })
52
+ if @uuid_field.nil?
53
+ messages.append({ 'Body' => JSON.generate(event.to_hash), 'BrokerProperties' => { 'ContentType' => 'application/json' } })
54
+ else
55
+ messages.append({ 'Body' => JSON.generate(event.to_hash), 'BrokerProperties' => { 'ContentType' => 'application/json', 'MessageId' => event.get(@uuid_field) } })
56
+ end
52
57
  end
53
58
  post_messages(messages)
54
59
  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.1.6'
3
+ s.version = '0.2.0'
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.1.6
4
+ version: 0.2.0
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-04 00:00:00.000000000 Z
11
+ date: 2022-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement