logstash-output-azure_event_hub 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +24 -0
- data/CONTRIBUTORS +12 -0
- data/Gemfile +11 -0
- data/LICENSE +13 -0
- data/NOTICE +52 -0
- data/README.md +75 -0
- data/lib/logstash-output-azure_event_hub_jars.rb +7 -0
- data/lib/logstash/outputs/azure_event_hub.rb +168 -0
- data/logstash-output-azure_event_hub.gemspec +36 -0
- data/spec/outputs/azure_event_hub_spec.rb +22 -0
- data/vendor/jar-dependencies/com/microsoft/azure/azure-eventhubs/2.3.2/azure-eventhubs-2.3.2.jar +0 -0
- data/vendor/jar-dependencies/com/microsoft/azure/qpid-proton-j-extensions/1.2.0/qpid-proton-j-extensions-1.2.0.jar +0 -0
- data/vendor/jar-dependencies/org/apache/qpid/proton-j/0.31.0/proton-j-0.31.0.jar +0 -0
- data/vendor/jar-dependencies/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar +0 -0
- metadata +141 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 92c02aa7bef06e8d12ad0174e34aaef9ee40e63d
|
4
|
+
data.tar.gz: d2c7baf509e175ea63deffc7d8d646f004cfe68f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1d20f3f15d42bff347522a46d88bcca7e053f8745334ee2147e3e19c5a2e1f51a8305d257758f7a2df0baabd6fc94f0145fc499765f270c76ae79513db2a12aa
|
7
|
+
data.tar.gz: 0e59da04342a64e9a80c62abbecd9dc30863f492b9e664c15a8727289a39999bef85e603557ad1f23ff2c1759c0b77b7e2cf60abcbc5b6dc72a9a2ef99240134
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file. Format is based on [Keep a Changelog]( https://keepachangelog.com/en/1.0.0/ ).
|
3
|
+
This project adheres to [Semantic Versioning]( https://semver.org/ ).
|
4
|
+
|
5
|
+
```
|
6
|
+
Example:
|
7
|
+
## \[Unreleased\]
|
8
|
+
### Added
|
9
|
+
### Changed
|
10
|
+
### Deprecated
|
11
|
+
### Removed
|
12
|
+
### Fixed
|
13
|
+
### Security
|
14
|
+
```
|
15
|
+
|
16
|
+
## \[0.1.1\] 2020-01-07
|
17
|
+
### Added
|
18
|
+
- Include .jar dependencies in gem
|
19
|
+
### Changed
|
20
|
+
- Bump gradle to 6.0.1
|
21
|
+
|
22
|
+
## \[0.1.0\] 2019-06-11
|
23
|
+
### Added
|
24
|
+
- Plugin created
|
data/CONTRIBUTORS
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
The following is a list of people who have contributed ideas, code, bug
|
2
|
+
reports, or in general have helped Logstash along its way.
|
3
|
+
|
4
|
+
Contributors:
|
5
|
+
* Nathan Gift (@TheNathanGift)
|
6
|
+
* Bryan K Lewis (@bryanklewis)
|
7
|
+
* James Davison III (@jedthe3rd)
|
8
|
+
|
9
|
+
Note: If you've sent us patches, bug reports, or otherwise contributed to
|
10
|
+
Logstash, and you aren't on the list above and want to be, please let us know
|
11
|
+
and we'll make sure you're here. Contributions from folks like you are what make
|
12
|
+
open source awesome.
|
data/Gemfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
|
6
|
+
use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
|
7
|
+
|
8
|
+
if Dir.exist?(logstash_path) && use_logstash_source
|
9
|
+
gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
|
10
|
+
gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
|
11
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright 2019 Micron Technology, Inc.
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
data/NOTICE
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
Acknowledgments
|
2
|
+
|
3
|
+
Portions of the plugin may utilize the following copyrighted material,
|
4
|
+
the use of which is hereby acknowledged.
|
5
|
+
|
6
|
+
##############################################################################
|
7
|
+
# Logstash Sample Plugin / Plugin Generator #
|
8
|
+
# Logstash Input Azure Event Hubs #
|
9
|
+
# Logstash Output Kafka Plugin #
|
10
|
+
##############################################################################
|
11
|
+
|
12
|
+
https://github.com/logstash-plugins/logstash-output-example
|
13
|
+
https://github.com/logstash-plugins/logstash-input-azure_event_hub
|
14
|
+
https://github.com/logstash-plugins/logstash-output-kafka
|
15
|
+
|
16
|
+
--------------------------------------------------------------
|
17
|
+
Copyright (c) 2012-2018 Elasticsearch <http://www.elastic.co>
|
18
|
+
|
19
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
20
|
+
you may not use this file except in compliance with the License.
|
21
|
+
You may obtain a copy of the License at
|
22
|
+
|
23
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
24
|
+
|
25
|
+
Unless required by applicable law or agreed to in writing, software
|
26
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
27
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
28
|
+
See the License for the specific language governing permissions and
|
29
|
+
limitations under the License.
|
30
|
+
|
31
|
+
|
32
|
+
##############################################################################
|
33
|
+
# Logstash Output Kusto Plugin #
|
34
|
+
##############################################################################
|
35
|
+
|
36
|
+
https://github.com/Azure/logstash-output-kusto
|
37
|
+
|
38
|
+
--------------------------------------------------------------
|
39
|
+
Copyright Microsoft Corporation. All rights reserved.
|
40
|
+
|
41
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
42
|
+
you may not use this file except in compliance with the License.
|
43
|
+
You may obtain a copy of the License at
|
44
|
+
|
45
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
46
|
+
|
47
|
+
Unless required by applicable law or agreed to in writing, software
|
48
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
49
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
50
|
+
See the License for the specific language governing permissions and
|
51
|
+
limitations under the License.
|
52
|
+
|
data/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# Logstash Output Plugin for Azure Event Hubs
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/logstash-output-azure_event_hub.svg)](https://badge.fury.io/rb/logstash-output-azure_event_hub)
|
3
|
+
|
4
|
+
This is a plugin for [Logstash](https://github.com/elastic/logstash). It is fully free and open source. The license is Apache 2.0.
|
5
|
+
This plugin enables you to send events from Elastic Logstash to an Azure [Event Hubs](https://azure.microsoft.com/en-us/services/event-hubs/) entity. The Azure Event Hubs [Java SDK](https://docs.microsoft.com/en-us/java/api/com.microsoft.azure.eventhubs.eventhubclient.sendsync?view=azure-java-stable) is used to send events via synchronous class methods over AMQP.
|
6
|
+
|
7
|
+
## Requirements
|
8
|
+
|
9
|
+
- Java 8 or 11 JDK/JRE. Recommend the [Azul Zulu](https://www.azul.com/downloads/zulu-community/) OpenJDK builds.
|
10
|
+
- Logstash version 7+. [Installation instructions](https://www.elastic.co/guide/en/logstash/current/installing-logstash.html)
|
11
|
+
- Azure Event Hubs namespace and hub.
|
12
|
+
- Read [Create an Event Hub](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-create) for more information.
|
13
|
+
- Credentials with permission to write data into Azure Event Hubs.
|
14
|
+
- [Create a SAS Policy Key](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string) for more information on viewing your connection screen or where to create a new key.
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
|
18
|
+
To make the Azure Event Hubs output plugin available in your Logstash environment, run the following command:
|
19
|
+
```sh
|
20
|
+
bin/logstash-plugin install logstash-output-azure_event_hub
|
21
|
+
```
|
22
|
+
|
23
|
+
## Configuration
|
24
|
+
|
25
|
+
Information about configuring Logstash can be found in the [Logstash configuration guide](https://www.elastic.co/guide/en/logstash/current/configuration.html).
|
26
|
+
|
27
|
+
You will need to configure this plugin before sending events from Logstash to Azure Event Hubs. The following example shows the minimum you need to provide:
|
28
|
+
|
29
|
+
```yaml
|
30
|
+
output {
|
31
|
+
azure_event_hub {
|
32
|
+
connection_string => "Endpoint=sb://namespace_DNS_Name;EntityPath=EVENT_HUB_NAME;SharedAccessKeyName=SHARED_ACCESS_KEY_NAME;SharedAccessKey=SHARED_ACCESS_KEY"
|
33
|
+
}
|
34
|
+
}
|
35
|
+
```
|
36
|
+
|
37
|
+
### Available Configuration Keys
|
38
|
+
|
39
|
+
| Parameter Name | Description | Notes |
|
40
|
+
| --- | --- | --- |
|
41
|
+
| connection_string | Connection string to the Azure Event Hub. Format: Endpoint=sb://namespace_DNS_Name;EntityPath=EVENT_HUB_NAME;SharedAccessKeyName=SHARED_ACCESS_KEY_NAME;SharedAccessKey=SHARED_ACCESS_KEY | Required.
|
42
|
+
| connection_retry_count | Number of times to retry a failed Event Hubs connection. | Default: 3
|
43
|
+
| properties_bag | Event metadata key=value pairs to set in the user-defined property bag. See [EventData](https://docs.microsoft.com/en-us/java/api/com.microsoft.azure.eventhubs.eventdata?view=azure-java-stable) class for more information. This config can be used to route events dynamically for [Azure Data Explorer]() by setting properties: <br>```"Table" => "%{[adx_table_name]}" "Format" => "json" "IngestionMappingReference" => "adx_ingest_map"``` | Format: ```properties_bag => { "key1" => "value1" "key2" => "%{[event_field]}" }```
|
44
|
+
| client_threads | Total threads used by Azure Event Hubs client to handle events. This value is used when creating the Java Concurrency Executor pool size. | Default: 4
|
45
|
+
|
46
|
+
## Development
|
47
|
+
|
48
|
+
- Jruby 9.2.6.0+
|
49
|
+
- Java 8/11 JDK
|
50
|
+
- Logstash version 7+.
|
51
|
+
- Azure Event Hubs namespace, hub, and credential to test against.
|
52
|
+
- [Gradle](https://gradle.org/install/) is used to download the .jar dependencies and generate the classpath file.
|
53
|
+
|
54
|
+
1. Install Dependencies
|
55
|
+
|
56
|
+
```shell
|
57
|
+
rake vendor
|
58
|
+
bundle install
|
59
|
+
```
|
60
|
+
or
|
61
|
+
```shell
|
62
|
+
gradle vendor --info
|
63
|
+
bundle install
|
64
|
+
```
|
65
|
+
|
66
|
+
2. Running your unpublished Plugin in Logstash
|
67
|
+
|
68
|
+
Run in a local Logstash clone. Edit the Logstash Gemfile and add the local plugin path at the top of the Gemfile, for example:
|
69
|
+
```
|
70
|
+
gem 'logstash-output-azure_event_hub', :path => '/path/to/logstash-output-azure_event_hub'
|
71
|
+
```
|
72
|
+
|
73
|
+
## Contributing
|
74
|
+
|
75
|
+
All contributions are welcome: ideas, patches, documentation, bug reports, and complaints. For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.
|
2
|
+
|
3
|
+
require 'jar_dependencies'
|
4
|
+
require_jar('org.apache.qpid', 'proton-j', '0.31.0')
|
5
|
+
require_jar('com.microsoft.azure', 'qpid-proton-j-extensions', '1.2.0')
|
6
|
+
require_jar('org.slf4j', 'slf4j-api', '1.7.25')
|
7
|
+
require_jar('com.microsoft.azure', 'azure-eventhubs', '2.3.2')
|
@@ -0,0 +1,168 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Copyright 2019 Micron Technology, Inc. <https://www.micron.com/>
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# This work contains copyrighted material, see NOTICE for
|
18
|
+
# additional copyright aknowledgements.
|
19
|
+
|
20
|
+
require 'logstash-output-azure_event_hub_jars'
|
21
|
+
require 'logstash/outputs/base'
|
22
|
+
require 'logstash/namespace'
|
23
|
+
require 'logstash/errors'
|
24
|
+
|
25
|
+
|
26
|
+
java_import com.microsoft.azure.eventhubs.ConnectionStringBuilder;
|
27
|
+
java_import com.microsoft.azure.eventhubs.EventData;
|
28
|
+
java_import com.microsoft.azure.eventhubs.EventHubClient;
|
29
|
+
java_import com.microsoft.azure.eventhubs.EventHubException;
|
30
|
+
java_import com.microsoft.azure.eventhubs.IllegalConnectionStringFormatException;
|
31
|
+
|
32
|
+
java_import java.io.IOException;
|
33
|
+
java_import java.nio.ByteBuffer;
|
34
|
+
java_import java.nio.charset.Charset;
|
35
|
+
java_import java.util.concurrent.ExecutionException;
|
36
|
+
java_import java.util.concurrent.Executors;
|
37
|
+
java_import java.util.concurrent.ScheduledExecutorService;
|
38
|
+
|
39
|
+
# Output plugin to send events to an Azure Event Hub.
|
40
|
+
class LogStash::Outputs::AzureEventHubs < LogStash::Outputs::Base
|
41
|
+
config_name "azure_event_hub"
|
42
|
+
|
43
|
+
# Azure Event Hub Connection String
|
44
|
+
config :connection_string, :validate => :string, :required => true, :default => nil
|
45
|
+
|
46
|
+
# Number of times to retry a failed Event Hubs connection
|
47
|
+
# Defaults to 3
|
48
|
+
config :connection_retry_count, :validate => :number, :required => false, :default => 3
|
49
|
+
|
50
|
+
# Properties Bag
|
51
|
+
# Event metadata key=value pairs to set in the user-defined property bag
|
52
|
+
# See the EventData class for more information
|
53
|
+
# https://docs.microsoft.com/en-us/java/api/com.microsoft.azure.eventhubs.eventdata?view=azure-java-stable
|
54
|
+
# Format: properties_bag => { "key1" => "value1" "key2" => "%{[event_field]}" }
|
55
|
+
config :properties_bag, :validate => :hash, :required => false, :default => nil
|
56
|
+
|
57
|
+
# Total threads used by Azure Event Hubs client to handle events
|
58
|
+
# Requires at minimum 2 threads
|
59
|
+
# Defaults to 4
|
60
|
+
config :client_threads, :validate => :number, :required => false, :default => 4
|
61
|
+
|
62
|
+
# Default serialize messages with JSON
|
63
|
+
default :codec, 'json'
|
64
|
+
|
65
|
+
public
|
66
|
+
def register
|
67
|
+
|
68
|
+
# The Executor handles all the asynchronous tasks and this is passed to the EventHubClient.
|
69
|
+
# The gives the user control to segregate their thread pool based on the work load.
|
70
|
+
# This pool can then be shared across multiple EventHubClient instances.
|
71
|
+
@executor_service = Executors.newScheduledThreadPool(@client_threads)
|
72
|
+
|
73
|
+
# Handle Transient errors when creating the Event Hubs Client
|
74
|
+
try = 0
|
75
|
+
retry_interval = 2
|
76
|
+
begin
|
77
|
+
# Each EventHubClient instance spins up a new TCP/SSL connection, which is expensive.
|
78
|
+
# It is always a best practice to reuse these instances.
|
79
|
+
if !@connection_string.nil? and @connection_string !~ /\A\s*\Z/
|
80
|
+
@eventhub_client = EventHubClient.createSync(@connection_string, @executor_service)
|
81
|
+
@codec.on_event(&method(:send_record))
|
82
|
+
else
|
83
|
+
@logger.warn("Connection String is empty, azure_event_hub output will be ignored and should not be called...")
|
84
|
+
@codec.on_event(&method(:log_no_msg_sent))
|
85
|
+
end
|
86
|
+
|
87
|
+
rescue IllegalConnectionStringFormatException, IOException => e
|
88
|
+
@logger.error(
|
89
|
+
"Unable to establish connection to Azure Event Hubs.",
|
90
|
+
:error_message => e.getMessage(),
|
91
|
+
:class => e.class.name
|
92
|
+
)
|
93
|
+
close()
|
94
|
+
exit(1)
|
95
|
+
rescue EventHubException, ExecutionException => e
|
96
|
+
# Log error, no retry
|
97
|
+
if (e.is_a?(EventHubException) and e.getIsTransient() != true) or try >= @connection_retry_count
|
98
|
+
@logger.error(
|
99
|
+
"Unable to establish connection to Azure Event Hubs.",
|
100
|
+
:error_message => e.getMessage(),
|
101
|
+
:class => e.class.name
|
102
|
+
)
|
103
|
+
close()
|
104
|
+
exit(1)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Log error with retry
|
108
|
+
@logger.error(
|
109
|
+
"Connection to Event Hubs failed, will attempt connection again.",
|
110
|
+
:error_message => e.getMessage(),
|
111
|
+
:class => e.class.name,
|
112
|
+
:retry_in_seconds => retry_interval
|
113
|
+
)
|
114
|
+
|
115
|
+
# Wait for interval
|
116
|
+
sleep(retry_interval)
|
117
|
+
|
118
|
+
# Add attempt and retry
|
119
|
+
try += 1
|
120
|
+
retry
|
121
|
+
end
|
122
|
+
end # def register
|
123
|
+
|
124
|
+
public
|
125
|
+
def close
|
126
|
+
if (!@eventhub_client.nil?)
|
127
|
+
@eventhub_client.closeSync();
|
128
|
+
end
|
129
|
+
@executor_service.shutdown();
|
130
|
+
end # def close
|
131
|
+
|
132
|
+
public
|
133
|
+
def receive(event)
|
134
|
+
begin
|
135
|
+
@codec.encode(event)
|
136
|
+
rescue => e
|
137
|
+
@logger.warn("Error encoding event", :exception => e, :event => event)
|
138
|
+
end
|
139
|
+
end # def receive
|
140
|
+
|
141
|
+
private
|
142
|
+
def send_record(event, payload)
|
143
|
+
begin
|
144
|
+
# Create EventData object and convert payload to bytes
|
145
|
+
eh_event = EventData.create(ByteBuffer::wrap(payload.to_java_bytes))
|
146
|
+
|
147
|
+
# Add property bag
|
148
|
+
if (!@properties_bag.nil?)
|
149
|
+
@properties_bag.each do |key, value|
|
150
|
+
eh_event.getProperties().put(event.sprintf(key).to_java_string, event.sprintf(value).to_java_string)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
# Send using client
|
155
|
+
@eventhub_client.sendSync(eh_event)
|
156
|
+
rescue => e
|
157
|
+
@logger.warn("Error sending event", :exception => e, :event => event)
|
158
|
+
end
|
159
|
+
end # def send_record
|
160
|
+
|
161
|
+
private
|
162
|
+
def log_no_msg_sent(event, payload)
|
163
|
+
begin
|
164
|
+
@logger.warn("Event ignored, connection string not set")
|
165
|
+
end
|
166
|
+
end # def log_no_msg_sent
|
167
|
+
|
168
|
+
end # class LogStash::Outputs::AzureEventHubs
|
@@ -0,0 +1,36 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'logstash-output-azure_event_hub'
|
3
|
+
s.version = '0.1.2'
|
4
|
+
s.licenses = ['Apache License (2.0)']
|
5
|
+
s.summary = 'Writes events to an Azure Event Hub'
|
6
|
+
s.description = 'This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install logstash-output-azure_event_hub. This gem is not a stand-alone program.'
|
7
|
+
s.homepage = 'https://github.com/TheNathanGift/logstash-output_azure_event_hub'
|
8
|
+
s.authors = ['Nathan Gift']
|
9
|
+
s.email = 'nathanjgift@gmail.com'
|
10
|
+
s.require_paths = ['lib', 'vendor/jar-dependencies']
|
11
|
+
|
12
|
+
# Files
|
13
|
+
s.files = Dir['lib/**/*', 'spec/**/*', 'vendor/**/*','vendor/jar-dependencies/**/*.jar', 'vendor/jar-dependencies/**/*.rb', '*.gemspec', '*.md', 'CONTRIBUTORS', 'Gemfile', 'LICENSE', 'VERSION', 'NOTICE']
|
14
|
+
|
15
|
+
# Tests
|
16
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
17
|
+
|
18
|
+
# Metadata "logstash_* => .." are special flags to indicate this a logstash plugin
|
19
|
+
s.metadata = {
|
20
|
+
"logstash_plugin" => "true",
|
21
|
+
"logstash_group" => "output",
|
22
|
+
"source_code_uri" => "https://github.com/TheNathanGift/logstash-output_azure_event_hub",
|
23
|
+
"allowed_push_host" => "https://rubygems.org"
|
24
|
+
}
|
25
|
+
|
26
|
+
# Gem dependencies
|
27
|
+
s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
|
28
|
+
#s.add_runtime_dependency "logstash-core", ">= 6.5.0"
|
29
|
+
s.add_runtime_dependency 'logstash-codec-plain'
|
30
|
+
s.add_runtime_dependency 'logstash-codec-json'
|
31
|
+
|
32
|
+
s.add_development_dependency 'logstash-devutils'
|
33
|
+
|
34
|
+
# Jar dependencies
|
35
|
+
s.add_development_dependency 'jar-dependencies'
|
36
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "logstash/devutils/rspec/spec_helper"
|
3
|
+
require "logstash/outputs/azure_event_hub"
|
4
|
+
require "logstash/codecs/plain"
|
5
|
+
require "logstash/event"
|
6
|
+
|
7
|
+
describe LogStash::Outputs::AzureEventHubs do
|
8
|
+
let(:sample_event) { LogStash::Event.new }
|
9
|
+
let(:output) { LogStash::Outputs::AzureEventHubs.new }
|
10
|
+
|
11
|
+
before do
|
12
|
+
output.register
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "receive message" do
|
16
|
+
subject { output.receive(sample_event) }
|
17
|
+
|
18
|
+
it "returns a string" do
|
19
|
+
expect(subject).to eq("Event received")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/vendor/jar-dependencies/com/microsoft/azure/azure-eventhubs/2.3.2/azure-eventhubs-2.3.2.jar
ADDED
Binary file
|
Binary file
|
metadata
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: logstash-output-azure_event_hub
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nathan Gift
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-05-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '1.60'
|
19
|
+
- - "<="
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2.99'
|
22
|
+
name: logstash-core-plugin-api
|
23
|
+
prerelease: false
|
24
|
+
type: :runtime
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.60'
|
30
|
+
- - "<="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.99'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
name: logstash-codec-plain
|
40
|
+
prerelease: false
|
41
|
+
type: :runtime
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
name: logstash-codec-json
|
54
|
+
prerelease: false
|
55
|
+
type: :runtime
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
name: logstash-devutils
|
68
|
+
prerelease: false
|
69
|
+
type: :development
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
name: jar-dependencies
|
82
|
+
prerelease: false
|
83
|
+
type: :development
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
description: This gem is a logstash plugin required to be installed on top of the
|
90
|
+
Logstash core pipeline using $LS_HOME/bin/logstash-plugin install logstash-output-azure_event_hub.
|
91
|
+
This gem is not a stand-alone program.
|
92
|
+
email: nathanjgift@gmail.com
|
93
|
+
executables: []
|
94
|
+
extensions: []
|
95
|
+
extra_rdoc_files: []
|
96
|
+
files:
|
97
|
+
- CHANGELOG.md
|
98
|
+
- CONTRIBUTORS
|
99
|
+
- Gemfile
|
100
|
+
- LICENSE
|
101
|
+
- NOTICE
|
102
|
+
- README.md
|
103
|
+
- lib/logstash-output-azure_event_hub_jars.rb
|
104
|
+
- lib/logstash/outputs/azure_event_hub.rb
|
105
|
+
- logstash-output-azure_event_hub.gemspec
|
106
|
+
- spec/outputs/azure_event_hub_spec.rb
|
107
|
+
- vendor/jar-dependencies/com/microsoft/azure/azure-eventhubs/2.3.2/azure-eventhubs-2.3.2.jar
|
108
|
+
- vendor/jar-dependencies/com/microsoft/azure/qpid-proton-j-extensions/1.2.0/qpid-proton-j-extensions-1.2.0.jar
|
109
|
+
- vendor/jar-dependencies/org/apache/qpid/proton-j/0.31.0/proton-j-0.31.0.jar
|
110
|
+
- vendor/jar-dependencies/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar
|
111
|
+
homepage: https://github.com/TheNathanGift/logstash-output_azure_event_hub
|
112
|
+
licenses:
|
113
|
+
- Apache License (2.0)
|
114
|
+
metadata:
|
115
|
+
logstash_plugin: 'true'
|
116
|
+
logstash_group: output
|
117
|
+
source_code_uri: https://github.com/TheNathanGift/logstash-output_azure_event_hub
|
118
|
+
allowed_push_host: https://rubygems.org
|
119
|
+
post_install_message:
|
120
|
+
rdoc_options: []
|
121
|
+
require_paths:
|
122
|
+
- lib
|
123
|
+
- vendor/jar-dependencies
|
124
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
129
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
requirements: []
|
135
|
+
rubyforge_project:
|
136
|
+
rubygems_version: 2.6.14.1
|
137
|
+
signing_key:
|
138
|
+
specification_version: 4
|
139
|
+
summary: Writes events to an Azure Event Hub
|
140
|
+
test_files:
|
141
|
+
- spec/outputs/azure_event_hub_spec.rb
|