logstash-output-azure_event_hubs 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +18 -0
- data/CONTRIBUTORS +11 -0
- data/Gemfile +11 -0
- data/LICENSE +13 -0
- data/NOTICE +52 -0
- data/README.md +79 -0
- data/VERSION +1 -0
- data/lib/logstash-output-azure_event_hubs_jars.rb +7 -0
- data/lib/logstash/outputs/azure_event_hubs.rb +170 -0
- data/logstash-output-azure_event_hubs.gemspec +37 -0
- data/spec/outputs/azure_event_hubs_spec.rb +22 -0
- metadata +131 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8d1ae4dbc16152ca2c3f2aa566aa21e343a9dee8baf1373ff74b444814eac990
|
4
|
+
data.tar.gz: 21074907a28e05132fc8d15d19caf16de11daeb3bb9d446361320da0e8a94b1c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2755e3b5b8f9a8c782da650435e5a58c0713de9a60dd7b55dc51399f2717cae1c5a4353b84ec0f778e0dc3d25c88b2c759fdd3c8877df86ef9d6c189ef7e3b85
|
7
|
+
data.tar.gz: 68a7a595d8c673c53fb31d82e4381b8c2e3bab8031f99a8f82978a785972639c20e80fbc009a10cd5684173a672dbc126d42607644ecde4410b1a23c5584db33
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,18 @@
|
|
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
|
+
## \[Unreleased\]
|
7
|
+
### Added
|
8
|
+
### Changed
|
9
|
+
### Deprecated
|
10
|
+
### Removed
|
11
|
+
### Fixed
|
12
|
+
### Security
|
13
|
+
|
14
|
+
***
|
15
|
+
|
16
|
+
## \[0.1.0\] 2019-06-11
|
17
|
+
### Added
|
18
|
+
- Plugin created
|
data/CONTRIBUTORS
ADDED
@@ -0,0 +1,11 @@
|
|
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
|
+
* Bryan K Lewis (@bryanklewis)
|
6
|
+
* James Davison III (@jedthe3rd)
|
7
|
+
|
8
|
+
Note: If you've sent us patches, bug reports, or otherwise contributed to
|
9
|
+
Logstash, and you aren't on the list above and want to be, please let us know
|
10
|
+
and we'll make sure you're here. Contributions from folks like you are what make
|
11
|
+
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_hubs
|
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,79 @@
|
|
1
|
+
# Logstash Output Plugin for Azure Event Hubs
|
2
|
+
|
3
|
+
This is a plugin for [Logstash](https://github.com/elastic/logstash). It is fully free and open source. The license is Apache 2.0.
|
4
|
+
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.
|
5
|
+
|
6
|
+
## Requirements
|
7
|
+
|
8
|
+
- Java 11 JDK or JRE. Recommend the [Azul Zulu](https://www.elastic.co/guide/en/logstash/current/installing-logstash.html) OpenJDK builds.
|
9
|
+
- Logstash version 7+. [Installation instructions](https://www.elastic.co/guide/en/logstash/current/installing-logstash.html)
|
10
|
+
- Azure Event Hubs namespace and hub.
|
11
|
+
- Read [Create an Event Hub](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-create) for more information.
|
12
|
+
- Credentials with permission to write data into Azure Event Hubs.
|
13
|
+
- [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.
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
To make the Azure Event Hubs output plugin available in your Logstash environment, run the following command:
|
18
|
+
```sh
|
19
|
+
bin/logstash-plugin install logstash-output-azure_event_hubs
|
20
|
+
```
|
21
|
+
|
22
|
+
## Configuration
|
23
|
+
|
24
|
+
Information about configuring Logstash can be found in the [Logstash configuration guide](https://www.elastic.co/guide/en/logstash/current/configuration.html).
|
25
|
+
|
26
|
+
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:
|
27
|
+
|
28
|
+
```yaml
|
29
|
+
output {
|
30
|
+
azure_event_hubs {
|
31
|
+
service_namespace => "myeventnamespace" #Exclude .servicebus.windows.net
|
32
|
+
event_hub => "logs"
|
33
|
+
sas_key_name => "myeventnamespace-write"
|
34
|
+
sas_key => '...'
|
35
|
+
}
|
36
|
+
}
|
37
|
+
```
|
38
|
+
|
39
|
+
### Available Configuration Keys
|
40
|
+
|
41
|
+
| Parameter Name | Description | Notes |
|
42
|
+
| --- | --- | --- |
|
43
|
+
| service_namespace | Azure Service Namespace or Endpoint. | Required.
|
44
|
+
| service_uri | Use a national Azure Cloud. |
|
45
|
+
| event_hub | Azure Event Hub (Entity) Path. | Required
|
46
|
+
| sas_key_name | Azure Shared Access Signature (SAS) Key Name. | Required
|
47
|
+
| sas_key | Azure Shared Access Signature (SAS) Key. | Required
|
48
|
+
| connection_retry_count | Number of times to retry a failed Event Hubs connection. | Default: 3
|
49
|
+
| 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]}" }```
|
50
|
+
| 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
|
51
|
+
|
52
|
+
## Development
|
53
|
+
|
54
|
+
- Jruby 9.2.6.0+
|
55
|
+
- Java 11 JDK
|
56
|
+
- Logstash version 7+.
|
57
|
+
- Azure Event Hubs namespace, hub, and credential to test against.
|
58
|
+
- [Gradle](https://gradle.org/install/) is used to download the .jar dependencies and generate the classpath file by running:
|
59
|
+
|
60
|
+
1. Install Dependencies
|
61
|
+
```shell
|
62
|
+
rake vendor
|
63
|
+
bundle install
|
64
|
+
```
|
65
|
+
or
|
66
|
+
```shell
|
67
|
+
gradle vendor --info
|
68
|
+
bundle install
|
69
|
+
```
|
70
|
+
|
71
|
+
2. Running your unpublished Plugin in Logstash
|
72
|
+
Run in a local Logstash clone. Edit the Logstash Gemfile and add the local plugin path at the top of the Gemfile, for example:
|
73
|
+
```
|
74
|
+
gem 'logstash-output-azure_event_hubs', :path => '/path/to/logstash-output-azure_event_hubs'
|
75
|
+
```
|
76
|
+
|
77
|
+
## Contributing
|
78
|
+
|
79
|
+
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.
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -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,170 @@
|
|
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_hubs_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
|
+
|
31
|
+
java_import java.io.IOException;
|
32
|
+
java_import java.nio.ByteBuffer;
|
33
|
+
java_import java.nio.charset.Charset;
|
34
|
+
java_import java.util.concurrent.ExecutionException;
|
35
|
+
java_import java.util.concurrent.Executors;
|
36
|
+
java_import java.util.concurrent.ScheduledExecutorService;
|
37
|
+
|
38
|
+
# Output plugin to send events to an Azure Event Hub.
|
39
|
+
class LogStash::Outputs::AzureEventHubs < LogStash::Outputs::Base
|
40
|
+
config_name "azure_event_hubs"
|
41
|
+
|
42
|
+
# Azure Service Namespace or Endpoint
|
43
|
+
config :service_namespace, :validate => :string, :required => true, :default => nil
|
44
|
+
|
45
|
+
# Azure Service URI
|
46
|
+
# Use a national Azure Cloud
|
47
|
+
config :service_uri, :validate => :string, :required => false, :default => nil
|
48
|
+
|
49
|
+
# Azure Event Hub (Entity) Path
|
50
|
+
config :event_hub, :validate => :string, :required => true, :default => nil
|
51
|
+
|
52
|
+
# Azure Shared Access Signature (SAS) Key Name
|
53
|
+
config :sas_key_name, :validate => :string, :required => true, :default => nil
|
54
|
+
|
55
|
+
# Azure Shared Access Signature (SAS) Key
|
56
|
+
config :sas_key, :validate => :string, :required => true, :default => nil
|
57
|
+
|
58
|
+
# Number of times to retry a failed Event Hubs connection
|
59
|
+
# Defaults to 3
|
60
|
+
config :connection_retry_count, :validate => :number, :required => false, :default => 3
|
61
|
+
|
62
|
+
# Properties Bag
|
63
|
+
# Event metadata key=value pairs to set in the user-defined property bag
|
64
|
+
# See the EventData class for more information
|
65
|
+
# https://docs.microsoft.com/en-us/java/api/com.microsoft.azure.eventhubs.eventdata?view=azure-java-stable
|
66
|
+
# Format: properties_bag => { "key1" => "value1" "key2" => "%{[event_field]}" }
|
67
|
+
config :properties_bag, :validate => :hash, :required => false, :default => nil
|
68
|
+
|
69
|
+
# Total threads used by Azure Event Hubs client to handle events
|
70
|
+
# Requires at minimum 2 threads
|
71
|
+
# Defaults to 4
|
72
|
+
config :client_threads, :validate => :number, :required => false, :default => 4
|
73
|
+
|
74
|
+
# Default serialize messages with JSON
|
75
|
+
default :codec, 'json'
|
76
|
+
|
77
|
+
public
|
78
|
+
def register
|
79
|
+
# Build Event Hubs client connection string
|
80
|
+
connection_builder = ConnectionStringBuilder.new()
|
81
|
+
connection_builder.setNamespaceName(@service_namespace)
|
82
|
+
connection_builder.setEventHubName(@event_hub)
|
83
|
+
connection_builder.setSasKeyName(@sas_key_name)
|
84
|
+
connection_builder.setSasKey(@sas_key)
|
85
|
+
|
86
|
+
# Configure for national cloud uri
|
87
|
+
if (!@service_uri.nil?)
|
88
|
+
connection_builder.setEndpoint(@service_uri)
|
89
|
+
end
|
90
|
+
|
91
|
+
# The Executor handles all the asynchronous tasks and this is passed to the EventHubClient.
|
92
|
+
# The gives the user control to segregate their thread pool based on the work load.
|
93
|
+
# This pool can then be shared across multiple EventHubClient instances.
|
94
|
+
@executor_service = Executors.newScheduledThreadPool(@client_threads)
|
95
|
+
|
96
|
+
# Handle Transient errors when creating the Event Hubs Client
|
97
|
+
try = 0
|
98
|
+
retry_interval = 2
|
99
|
+
begin
|
100
|
+
# Each EventHubClient instance spins up a new TCP/SSL connection, which is expensive.
|
101
|
+
# It is always a best practice to reuse these instances.
|
102
|
+
@eventhub_client = EventHubClient.createSync(connection_builder.toString(), @executor_service)
|
103
|
+
|
104
|
+
rescue EventHubException, ExecutionException, InterruptedException, IOException => e
|
105
|
+
# Log error, no retry
|
106
|
+
if e.getIsTransient() != true or e == IOException or try >= @connection_retry_count
|
107
|
+
@logger.error(
|
108
|
+
"Unable to establish connection to Azure Event Hubs.",
|
109
|
+
:error_message => e.getMessage(),
|
110
|
+
:class => e.class.name
|
111
|
+
)
|
112
|
+
close()
|
113
|
+
exit(1)
|
114
|
+
end
|
115
|
+
|
116
|
+
# Log error with retry
|
117
|
+
@logger.error(
|
118
|
+
"Connection to Event Hubs failed, will attempt connection again.",
|
119
|
+
:error_message => e.getMessage(),
|
120
|
+
:class => e.class.name,
|
121
|
+
:retry_in_seconds => retry_interval
|
122
|
+
)
|
123
|
+
|
124
|
+
# Wait for interval
|
125
|
+
sleep(retry_interval)
|
126
|
+
|
127
|
+
# Add attempt and retry
|
128
|
+
try += 1
|
129
|
+
retry
|
130
|
+
end
|
131
|
+
|
132
|
+
# Pass event to sender on encode
|
133
|
+
@codec.on_event(&method(:send_record))
|
134
|
+
end # def register
|
135
|
+
|
136
|
+
public
|
137
|
+
def close
|
138
|
+
@eventhub_client.closeSync();
|
139
|
+
@executor_service.shutdown();
|
140
|
+
end # def close
|
141
|
+
|
142
|
+
public
|
143
|
+
def receive(event)
|
144
|
+
begin
|
145
|
+
@codec.encode(event)
|
146
|
+
rescue => e
|
147
|
+
@logger.warn("Error encoding event", :exception => e, :event => event)
|
148
|
+
end
|
149
|
+
end # def receive
|
150
|
+
|
151
|
+
private
|
152
|
+
def send_record(event, payload)
|
153
|
+
begin
|
154
|
+
# Create EventData object and convert payload to bytes
|
155
|
+
eh_event = EventData.create(ByteBuffer::wrap(payload.to_java_bytes))
|
156
|
+
|
157
|
+
# Add property bag
|
158
|
+
if (!@properties_bag.nil?)
|
159
|
+
@properties_bag.each do |key, value|
|
160
|
+
eh_event.getProperties().put(event.sprintf(key).to_java_string, event.sprintf(value).to_java_string)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
# Send using client
|
165
|
+
@eventhub_client.sendSync(eh_event)
|
166
|
+
rescue => e
|
167
|
+
@logger.warn("Error sending event", :exception => e, :event => event)
|
168
|
+
end
|
169
|
+
end # def send_record
|
170
|
+
end # class LogStash::Outputs::AzureEventHubs
|
@@ -0,0 +1,37 @@
|
|
1
|
+
GEM_VERSION = File.read(File.expand_path(File.join(File.dirname(__FILE__), "VERSION"))).strip unless defined?(GEM_VERSION)
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = 'logstash-output-azure_event_hubs'
|
5
|
+
s.version = GEM_VERSION
|
6
|
+
s.licenses = ['Apache-2.0']
|
7
|
+
s.summary = 'Writes events to Azure Event Hubs'
|
8
|
+
s.description = 'This is a Logstash output plugin used to write events to an Azure Event Hub'
|
9
|
+
s.homepage = 'https://github.com/bryanklewis/logstash-output-azure_event_hubs'
|
10
|
+
s.authors = ['Bryan Lewis']
|
11
|
+
s.email = 'dbre@micron.com'
|
12
|
+
s.require_paths = ['lib', 'vendor/jar-dependencies']
|
13
|
+
|
14
|
+
# Files
|
15
|
+
s.files = Dir['lib/**/*', 'spec/**/*', 'vendor/jar-dependencies/**/*.jar', 'vendor/jar-dependencies/**/*.rb', '*.gemspec', '*.md', 'CONTRIBUTORS', 'Gemfile', 'LICENSE', 'VERSION', 'NOTICE']
|
16
|
+
|
17
|
+
# Tests
|
18
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
19
|
+
|
20
|
+
# Metadata "logstash_* => .." are special flags to indicate this a logstash plugin
|
21
|
+
s.metadata = {
|
22
|
+
"logstash_plugin" => "true",
|
23
|
+
"logstash_group" => "output",
|
24
|
+
"source_code_uri" => "https://github.com/bryanklewis/logstash-output-azure_event_hubs",
|
25
|
+
"allowed_push_host" => "https://rubygems.org"
|
26
|
+
}
|
27
|
+
|
28
|
+
# Gem dependencies
|
29
|
+
s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"
|
30
|
+
s.add_runtime_dependency 'logstash-codec-plain'
|
31
|
+
s.add_runtime_dependency 'logstash-codec-json'
|
32
|
+
|
33
|
+
s.add_development_dependency 'logstash-devutils'
|
34
|
+
|
35
|
+
# Jar dependencies
|
36
|
+
s.add_development_dependency 'jar-dependencies'
|
37
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "logstash/devutils/rspec/spec_helper"
|
3
|
+
require "logstash/outputs/azure_event_hubs"
|
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
|
metadata
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: logstash-output-azure_event_hubs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bryan Lewis
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-06-11 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: '2.0'
|
19
|
+
name: logstash-core-plugin-api
|
20
|
+
prerelease: false
|
21
|
+
type: :runtime
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
name: logstash-codec-plain
|
34
|
+
prerelease: false
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
name: logstash-codec-json
|
48
|
+
prerelease: false
|
49
|
+
type: :runtime
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
name: logstash-devutils
|
62
|
+
prerelease: false
|
63
|
+
type: :development
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
name: jar-dependencies
|
76
|
+
prerelease: false
|
77
|
+
type: :development
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: This is a Logstash output plugin used to write events to an Azure Event
|
84
|
+
Hub
|
85
|
+
email: dbre@micron.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- CHANGELOG.md
|
91
|
+
- CONTRIBUTORS
|
92
|
+
- Gemfile
|
93
|
+
- LICENSE
|
94
|
+
- NOTICE
|
95
|
+
- README.md
|
96
|
+
- VERSION
|
97
|
+
- lib/logstash-output-azure_event_hubs_jars.rb
|
98
|
+
- lib/logstash/outputs/azure_event_hubs.rb
|
99
|
+
- logstash-output-azure_event_hubs.gemspec
|
100
|
+
- spec/outputs/azure_event_hubs_spec.rb
|
101
|
+
homepage: https://github.com/bryanklewis/logstash-output-azure_event_hubs
|
102
|
+
licenses:
|
103
|
+
- Apache-2.0
|
104
|
+
metadata:
|
105
|
+
logstash_plugin: 'true'
|
106
|
+
logstash_group: output
|
107
|
+
source_code_uri: https://github.com/bryanklewis/logstash-output-azure_event_hubs
|
108
|
+
allowed_push_host: https://rubygems.org
|
109
|
+
post_install_message:
|
110
|
+
rdoc_options: []
|
111
|
+
require_paths:
|
112
|
+
- lib
|
113
|
+
- vendor/jar-dependencies
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
requirements: []
|
125
|
+
rubyforge_project:
|
126
|
+
rubygems_version: 2.7.6
|
127
|
+
signing_key:
|
128
|
+
specification_version: 4
|
129
|
+
summary: Writes events to Azure Event Hubs
|
130
|
+
test_files:
|
131
|
+
- spec/outputs/azure_event_hubs_spec.rb
|