logstash-output-azure_service_bus 0.1.0 → 0.1.2
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 -75
- data/lib/logstash/outputs/azure_service_bus.rb +3 -2
- 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: aee180a4de7f1cec74146391480be5655321cf59013f22ad4cee6031f8872bad
|
4
|
+
data.tar.gz: 4c821ee449982194face2e3fd8149c97f6bb86064582f452cbb4125273af4537
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2bcb2bcecdd615a4aeb1152f86c81b6369d16a50e1ce275193b1ea5179261d796b0160ec9e0118272dc40f57b97b52054277034172b1fa61424bc0f88664484
|
7
|
+
data.tar.gz: 19b0c53310d0435cacef667d42f6144dddad8d5dac7940bb52c7c777fbda6acd7da7ec178981445d4499f757cf33cfb871b4b6f8f65fc25efdfb48c0437bb8b3
|
data/README.md
CHANGED
@@ -1,86 +1,27 @@
|
|
1
1
|
# logstash-output-azure_service_bus
|
2
2
|
|
3
|
-
This
|
3
|
+
This plugin allows you to stream events from [Logstash](https://github.com/elastic/logstash) to a topic or queue in [Azure Service Bus](https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview). Currently, the only supported authentication mechanism is using [managed identities](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview) which means this plugin must be run in an Azure compute environment. The entire Logstash event (not just the message) is passed to Service Bus with a content type of `application/json`.
|
4
4
|
|
5
|
-
|
5
|
+
This plugin is hosted on RubyGems.org: [https://rubygems.org/gems/logstash-output-azure_service_bus](https://rubygems.org/gems/logstash-output-azure_service_bus)
|
6
6
|
|
7
|
-
##
|
8
|
-
|
9
|
-
Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/).
|
10
|
-
|
11
|
-
- For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
|
12
|
-
- For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
|
13
|
-
|
14
|
-
## Need Help?
|
15
|
-
|
16
|
-
Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
|
17
|
-
|
18
|
-
## Developing
|
19
|
-
|
20
|
-
### 1. Plugin Developement and Testing
|
21
|
-
|
22
|
-
#### Code
|
23
|
-
- To get started, you'll need JRuby with the Bundler gem installed.
|
24
|
-
|
25
|
-
- Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization. We also provide [example plugins](https://github.com/logstash-plugins?query=example).
|
26
|
-
|
27
|
-
- Install dependencies
|
28
|
-
```sh
|
29
|
-
bundle install
|
30
|
-
```
|
31
|
-
|
32
|
-
#### Test
|
33
|
-
|
34
|
-
- Update your dependencies
|
35
|
-
|
36
|
-
```sh
|
37
|
-
bundle install
|
7
|
+
## Install
|
8
|
+
To install, use the plugin tool that is part of your Logstash installation:
|
38
9
|
```
|
39
|
-
|
40
|
-
- Run tests
|
41
|
-
|
42
|
-
```sh
|
43
|
-
bundle exec rspec
|
10
|
+
$LOGSTASH_INSTALL/bin/logstash-plugin install logstash-output-azure_service_bus
|
44
11
|
```
|
45
12
|
|
46
|
-
|
13
|
+
## Pipeline Configuration
|
14
|
+
As mentioned above, the compute environment that Logstash is running in must have managed identity enabled. In addition, the managed identity should have permissions to send to the desired queue or topic - typically the `Azure Service Bus Data Sender` role.
|
47
15
|
|
48
|
-
|
49
|
-
|
50
|
-
- Edit Logstash `Gemfile` and add the local plugin path, for example:
|
51
|
-
```ruby
|
52
|
-
gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
|
53
|
-
```
|
54
|
-
- Install plugin
|
55
|
-
```sh
|
56
|
-
bin/logstash-plugin install --no-verify
|
16
|
+
Two settings in your Logstash pipeline are required:
|
57
17
|
```
|
58
|
-
|
59
|
-
|
60
|
-
|
18
|
+
output {
|
19
|
+
azure_service_bus {
|
20
|
+
service_bus_namespace => "service-bus-name"
|
21
|
+
service_bus_entity => "queue-or-topic-name"
|
22
|
+
}
|
23
|
+
}
|
61
24
|
```
|
62
|
-
At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
|
63
|
-
|
64
|
-
#### 2.2 Run in an installed Logstash
|
65
|
-
|
66
|
-
You can use the same **2.1** method to run your plugin in an installed Logstash by editing its `Gemfile` and pointing the `:path` to your local plugin development directory or you can build the gem and install it using:
|
67
|
-
|
68
|
-
- Build your plugin gem
|
69
|
-
```sh
|
70
|
-
gem build logstash-filter-awesome.gemspec
|
71
|
-
```
|
72
|
-
- Install the plugin from the Logstash home
|
73
|
-
```sh
|
74
|
-
bin/logstash-plugin install /your/local/plugin/logstash-filter-awesome.gem
|
75
|
-
```
|
76
|
-
- Start Logstash and proceed to test the plugin
|
77
|
-
|
78
|
-
## Contributing
|
79
|
-
|
80
|
-
All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.
|
81
|
-
|
82
|
-
Programming is not a required skill. Whatever you've seen about open source and maintainers or community members saying "send patches or die" - you will not see that here.
|
83
|
-
|
84
|
-
It is more important to the community that you are able to contribute.
|
85
25
|
|
86
|
-
|
26
|
+
## Service Bus Configuration
|
27
|
+
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.
|
@@ -19,7 +19,8 @@ class LogStash::Outputs::AzureServiceBus < LogStash::Outputs::Base
|
|
19
19
|
interval_randomness: 0.5,
|
20
20
|
backoff_factor: 2,
|
21
21
|
retry_statuses: [429, 500],
|
22
|
-
exceptions: [Faraday::ConnectionFailed, Faraday::TimeoutError, Faraday::RetriableResponse,
|
22
|
+
exceptions: [Faraday::ConnectionFailed, Faraday::TimeoutError, Faraday::RetriableResponse],
|
23
|
+
methods: %i[get post]
|
23
24
|
}
|
24
25
|
@token_conn = Faraday.new(
|
25
26
|
url: 'http://169.254.169.254/metadata/identity/oauth2/token',
|
@@ -31,7 +32,7 @@ class LogStash::Outputs::AzureServiceBus < LogStash::Outputs::Base
|
|
31
32
|
end
|
32
33
|
@service_bus_conn = Faraday.new(
|
33
34
|
url: "https://#{@service_bus_namespace}.servicebus.windows.net/#{@service_bus_entity}/",
|
34
|
-
request: { timeout:
|
35
|
+
request: { timeout: 3 }
|
35
36
|
) do |f|
|
36
37
|
f.request :retry, retry_options
|
37
38
|
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.
|
3
|
+
s.version = '0.1.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.1.
|
4
|
+
version: 0.1.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-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|