logstash-output-azure_service_bus 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/lib/logstash/outputs/azure_service_bus.rb +3 -3
- data/logstash-output-azure_service_bus.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af1daf5ab0f287bfe29993a09437eb840063c5195d5dc9c247985fae757a09bd
|
4
|
+
data.tar.gz: afb35cc44123159129fc63fe5fcb374c7cb77ac98137b3b2ae0e513e96b12f09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3727d297acacbee56d2570ac67aca3e05bcc2f677b6ab5ab50c3acfa84aa721c683be70810fdcc26203124d615cbd99e6bb19fc5f1d68d3eccefd859e288d0e9
|
7
|
+
data.tar.gz: a72b4442be6118a0b933b2d3e9b6736a282e3024f32f00dd9bb4506b6096c02a824777ebe7535340d53eb9c152121b8e9bf2bf70c00d9d5b05b9ccb67307306e
|
data/README.md
CHANGED
@@ -22,6 +22,22 @@ output {
|
|
22
22
|
}
|
23
23
|
}
|
24
24
|
```
|
25
|
+
There is one optional setting (`messageid_field`) which sets the Service Bus `MessageId` value to an existing, unique field. If this setting is not used, Service Bus will generate an id when the message is created. The value of the provided field _must_ be unique or Service Bus will reject the message. A sample config might look like:
|
26
|
+
```
|
27
|
+
input { ... }
|
28
|
+
filter {
|
29
|
+
uuid {
|
30
|
+
target => "uuid"
|
31
|
+
}
|
32
|
+
}
|
33
|
+
output {
|
34
|
+
azure_service_bus {
|
35
|
+
service_bus_namespace => "service-bus-name"
|
36
|
+
service_bus_entity => "queue-or-topic-name"
|
37
|
+
messageid_field => "uuid"
|
38
|
+
}
|
39
|
+
}
|
40
|
+
```
|
25
41
|
|
26
42
|
## Service Bus Configuration
|
27
43
|
This plugin will retry sending messages if the Service Bus connection times out or returns a bad response. To avoid idempotence issues, you should enable duplicate detection on the destination queue or topic.
|
@@ -10,7 +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 :
|
13
|
+
config :messageid_field, :validate => :string
|
14
14
|
|
15
15
|
def register
|
16
16
|
retry_options = {
|
@@ -49,10 +49,10 @@ class LogStash::Outputs::AzureServiceBus < LogStash::Outputs::Base
|
|
49
49
|
def send_events(events)
|
50
50
|
messages = []
|
51
51
|
events.each do |event|
|
52
|
-
if @
|
52
|
+
if @messageid_field.nil?
|
53
53
|
messages.append({ 'Body' => JSON.generate(event.to_hash), 'BrokerProperties' => { 'ContentType' => 'application/json' } })
|
54
54
|
else
|
55
|
-
messages.append({ 'Body' => JSON.generate(event.to_hash), 'BrokerProperties' => { 'ContentType' => 'application/json', 'MessageId' => event.get(@
|
55
|
+
messages.append({ 'Body' => JSON.generate(event.to_hash), 'BrokerProperties' => { 'ContentType' => 'application/json', 'MessageId' => event.get(@messageid_field) } })
|
56
56
|
end
|
57
57
|
end
|
58
58
|
post_messages(messages)
|
@@ -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.1'
|
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'
|