Add a new command that generate a plugin skeleton that can be used to create a new plugin

Fixes #4190
This commit is contained in:
Pere Urbon-Bayes 2015-11-13 16:09:50 +01:00
parent 27882b1f2c
commit 1d5fc5735a
36 changed files with 750 additions and 1 deletions

View file

@ -113,4 +113,4 @@ Once set, plugin commands install, update can be used through this proxy.
include::offline-plugins.asciidoc[]
include::private-gem-repo.asciidoc[]
include::private-gem-repo.asciidoc[]

View file

@ -0,0 +1,90 @@
# encoding: utf-8
require "pluginmanager/command"
require "pluginmanager/templates/render_context"
require "erb"
require "ostruct"
require "fileutils"
class LogStash::PluginManager::Generate < LogStash::PluginManager::Command
TYPES = [ "input", "filter", "output" ]
option "--type", "TYPE", "Type of the plugin {input, filter, output}s" do |arg|
raise(ArgumentError, "should be one of: input, output or filter") unless TYPES.include?(arg)
arg
end
option "--name", "PLUGIN", "Name of the new plugin"
option "--path", "PATH", "Location where the plugin skeleton will be created", :default => Dir.pwd
def execute
source = File.join(File.dirname(__FILE__), "templates", "#{type}-plugin")
target_path = File.join(path, full_plugin_name)
FileUtils.mkdir(target_path)
puts " Creating #{target_path}"
begin
create_scaffold(source, target_path)
rescue Errno::EACCES => exception
report_exception("Permission denied when executing the plugin manager", exception)
rescue => exception
report_exception("Plugin creation Aborted", exception)
end
end
private
def create_scaffold(source, target)
transform_r(source, target)
end
def transform_r(source, target)
Dir.entries(source).each do |entry|
next if [ ".", ".." ].include?(entry)
source_entry = File.join(source, entry)
target_entry = File.join(target, entry)
if File.directory?(source_entry)
FileUtils.mkdir(target_entry) unless File.exists?(target_entry)
transform_r(source_entry, target_entry)
else
# copy the new file, in case of being an .erb file should render first
if source_entry.end_with?("erb")
target_entry = target_entry.gsub(/.erb$/,"").gsub("example", name)
File.open(target_entry, "w") { |f| f.write(render(source_entry)) }
else
FileUtils.cp(source_entry, target_entry)
end
puts "\t create #{File.join(full_plugin_name, File.basename(target_entry))}"
end
end
end
def render(source)
template = File.read(source)
renderer = ERB.new(template)
context = LogStash::PluginManager::RenderContext.new(options)
renderer.result(context.get_binding)
end
def options
git_data = get_git_info
@options ||= {
:plugin_name => name,
:author => git_data.author,
:email => git_data.email,
:min_version => "2.0",
}
end
def get_git_info
git = OpenStruct.new
git.author = %x{ git config --get user.name }.strip rescue "your_username"
git.email = %x{ git config --get user.email }.strip rescue "your_username@example.com"
git
end
def full_plugin_name
@full_plugin_name ||= "logstash-#{type}-#{name.downcase}"
end
end

View file

@ -20,6 +20,7 @@ require "pluginmanager/list"
require "pluginmanager/update"
require "pluginmanager/pack"
require "pluginmanager/unpack"
require "pluginmanager/generate"
module LogStash
module PluginManager
@ -32,6 +33,7 @@ module LogStash
subcommand "pack", "Package currently installed plugins", LogStash::PluginManager::Pack
subcommand "unpack", "Unpack packaged plugins", LogStash::PluginManager::Unpack
subcommand "list", "List all installed plugins", LogStash::PluginManager::List
subcommand "generate", "Create the foundation for a new plugin", LogStash::PluginManager::Generate
end
end
end

View file

@ -0,0 +1,2 @@
## 0.1.0
- Plugin created with the logstash plugin generator

View file

@ -0,0 +1,10 @@
The following is a list of people who have contributed ideas, code, bug
reports, or in general have helped logstash along its way.
Contributors:
* <%= author %> - <%= email %>
Note: If you've sent us patches, bug reports, or otherwise contributed to
Logstash, and you aren't on the list above and want to be, please let us know
and we'll make sure you're here. Contributions from folks like you are what make
open source awesome.

View file

@ -0,0 +1,2 @@
# logstash-filter-<%= plugin_name %>
Example filter plugin. This should help bootstrap your effort to write your own filter plugin!

View file

@ -0,0 +1,3 @@
source 'https://rubygems.org'
gemspec

View file

@ -0,0 +1,11 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -0,0 +1,86 @@
# Logstash Plugin
This is a plugin for [Logstash](https://github.com/elastic/logstash).
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
## Documentation
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/).
- For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
- For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
## Need Help?
Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
## Developing
### 1. Plugin Developement and Testing
#### Code
- To get started, you'll need JRuby with the Bundler gem installed.
- 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).
- Install dependencies
```sh
bundle install
```
#### Test
- Update your dependencies
```sh
bundle install
```
- Run tests
```sh
bundle exec rspec
```
### 2. Running your unpublished Plugin in Logstash
#### 2.1 Run in a local Logstash clone
- Edit Logstash `Gemfile` and add the local plugin path, for example:
```ruby
gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
```
- Install plugin
```sh
bin/logstash-plugin install --no-verify
```
- Run Logstash with your plugin
```sh
bin/logstash -e 'filter {awesome {}}'
```
At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
#### 2.2 Run in an installed Logstash
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:
- Build your plugin gem
```sh
gem build logstash-filter-awesome.gemspec
```
- Install the plugin from the Logstash home
```sh
bin/logstash-plugin install /your/local/plugin/logstash-filter-awesome.gem
```
- Start Logstash and proceed to test the plugin
## Contributing
All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.
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.
It is more important to the community that you are able to contribute.
For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.

View file

@ -0,0 +1 @@
require "logstash/devutils/rake"

View file

@ -0,0 +1,43 @@
# encoding: utf-8
require "logstash/filters/base"
require "logstash/namespace"
# This <%= @plugin_name %> filter will replace the contents of the default
# message field with whatever you specify in the configuration.
#
# It is only intended to be used as an <%= @plugin_name %>.
class LogStash::Filters::<%= classify(plugin_name) %> < LogStash::Filters::Base
# Setting the config_name here is required. This is how you
# configure this filter from your Logstash config.
#
# filter {
# <%= @plugin_name %> {
# message => "My message..."
# }
# }
#
config_name "<%= plugin_name %>"
# Replace the message with this value.
config :message, :validate => :string, :default => "Hello World!"
public
def register
# Add instance variables
end # def register
public
def filter(event)
if @message
# Replace the event message with our message as configured in the
# config file.
event["message"] = @message
end
# filter_matched should go in the last line of our successful code
filter_matched(event)
end # def filter
end # class LogStash::Filters::<%= classify(plugin_name) %>

View file

@ -0,0 +1,23 @@
Gem::Specification.new do |s|
s.name = 'logstash-filter-<%= plugin_name %>'
s.version = '0.1.0'
s.licenses = ['Apache License (2.0)']
s.summary = 'TODO: Write a short summary, because Rubygems requires one.'
s.description = 'TODO: Write a longer description or delete this line.'
s.homepage = 'TODO: Put your plugin's website or public repo URL here.'
s.authors = ['<%= author %>']
s.email = '<%= email %>'
s.require_paths = ['lib']
# Files
s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
# Tests
s.test_files = s.files.grep(%r{^(test|spec|features)/})
# Special flag to let us know this is actually a logstash plugin
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "filter" }
# Gem dependencies
s.add_runtime_dependency "logstash-core-plugin-api", "~> <%= min_version %>"
s.add_development_dependency 'logstash-devutils'
end

View file

@ -0,0 +1,21 @@
# encoding: utf-8
require_relative '../spec_helper'
require "logstash/filters/<%= plugin_name %>"
describe LogStash::Filters::<%= classify(plugin_name) %> do
describe "Set to Hello World" do
let(:config) do <<-CONFIG
filter {
<%= plugin_name %> {
message => "Hello World"
}
}
CONFIG
end
sample("message" => "some text") do
expect(subject).to include("message")
expect(subject['message']).to eq('Hello World')
end
end
end

View file

@ -0,0 +1,2 @@
# encoding: utf-8
require "logstash/devutils/rspec/spec_helper"

View file

@ -0,0 +1,2 @@
## 0.1.0
- Plugin created with the logstash plugin generator

View file

@ -0,0 +1,10 @@
The following is a list of people who have contributed ideas, code, bug
reports, or in general have helped logstash along its way.
Contributors:
* <%= author %> - <%= email %>
Note: If you've sent us patches, bug reports, or otherwise contributed to
Logstash, and you aren't on the list above and want to be, please let us know
and we'll make sure you're here. Contributions from folks like you are what make
open source awesome.

View file

@ -0,0 +1,2 @@
# logstash-input-<%= plugin_name %>
Example input plugin. This should help bootstrap your effort to write your own input plugin!

View file

@ -0,0 +1,3 @@
source 'https://rubygems.org'
gemspec

View file

@ -0,0 +1,11 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -0,0 +1,86 @@
# Logstash Plugin
This is a plugin for [Logstash](https://github.com/elastic/logstash).
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
## Documentation
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/).
- For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
- For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
## Need Help?
Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
## Developing
### 1. Plugin Developement and Testing
#### Code
- To get started, you'll need JRuby with the Bundler gem installed.
- 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).
- Install dependencies
```sh
bundle install
```
#### Test
- Update your dependencies
```sh
bundle install
```
- Run tests
```sh
bundle exec rspec
```
### 2. Running your unpublished Plugin in Logstash
#### 2.1 Run in a local Logstash clone
- Edit Logstash `Gemfile` and add the local plugin path, for example:
```ruby
gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
```
- Install plugin
```sh
bin/logstash-plugin install --no-verify
```
- Run Logstash with your plugin
```sh
bin/logstash -e 'filter {awesome {}}'
```
At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
#### 2.2 Run in an installed Logstash
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:
- Build your plugin gem
```sh
gem build logstash-filter-awesome.gemspec
```
- Install the plugin from the Logstash home
```sh
bin/logstash-plugin install /your/local/plugin/logstash-filter-awesome.gem
```
- Start Logstash and proceed to test the plugin
## Contributing
All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.
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.
It is more important to the community that you are able to contribute.
For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.

View file

@ -0,0 +1 @@
require "logstash/devutils/rake"

View file

@ -0,0 +1,51 @@
# encoding: utf-8
require "logstash/inputs/base"
require "logstash/namespace"
require "stud/interval"
require "socket" # for Socket.gethostname
# Generate a repeating message.
#
# This plugin is intented only as an example.
class LogStash::Inputs::<%= classify(plugin_name) %> < LogStash::Inputs::Base
config_name "<%= @lugin_name %>"
# If undefined, Logstash will complain, even if codec is unused.
default :codec, "plain"
# The message string to use in the event.
config :message, :validate => :string, :default => "Hello World!"
# Set how frequently messages should be sent.
#
# The default, `1`, means send a message every second.
config :interval, :validate => :number, :default => 1
public
def register
@host = Socket.gethostname
end # def register
def run(queue)
# we can abort the loop if stop? becomes true
while !stop?
event = LogStash::Event.new("message" => @message, "host" => @host)
decorate(event)
queue << event
# because the sleep interval can be big, when shutdown happens
# we want to be able to abort the sleep
# Stud.stoppable_sleep will frequently evaluate the given block
# and abort the sleep(@interval) if the return value is true
Stud.stoppable_sleep(@interval) { stop? }
end # loop
end # def run
def stop
# nothing to do in this case so it is not necessary to define stop
# examples of common "stop" tasks:
# * close sockets (unblocking blocking reads/accepts)
# * cleanup temporary files
# * terminate spawned threads
end
end # class LogStash::Inputs::<%= classify(plugin_name) %>

View file

@ -0,0 +1,25 @@
Gem::Specification.new do |s|
s.name = 'logstash-input-<%= plugin_name %>'
s.version = '0.1.0'
s.licenses = ['Apache License (2.0)']
s.summary = 'TODO: Write a short summary, because Rubygems requires one.'
s.description = '{TODO: Write a longer description or delete this line.'
s.homepage = 'TODO: Put your plugin's website or public repo URL here.'
s.authors = ['<%= author %>']
s.email = '<%= email %>'
s.require_paths = ['lib']
# Files
s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
# Tests
s.test_files = s.files.grep(%r{^(test|spec|features)/})
# Special flag to let us know this is actually a logstash plugin
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "input" }
# Gem dependencies
s.add_runtime_dependency "logstash-core-plugin-api", "~> <%= min_version %>"
s.add_runtime_dependency 'logstash-codec-plain'
s.add_runtime_dependency 'stud', '>= 0.0.22'
s.add_development_dependency 'logstash-devutils', '>= 0.0.16'
end

View file

@ -0,0 +1,11 @@
# encoding: utf-8
require "logstash/devutils/rspec/spec_helper"
require "logstash/inputs/<%= plugin_name %>"
describe LogStash::Inputs::<%= classify(plugin_name) %> do
it_behaves_like "an interruptible input plugin" do
let(:config) { { "interval" => 100 } }
end
end

View file

@ -0,0 +1,2 @@
## 0.1.0
- Plugin created with the logstash plugin generator

View file

@ -0,0 +1,10 @@
The following is a list of people who have contributed ideas, code, bug
reports, or in general have helped logstash along its way.
Contributors:
* <%= author %> - <%= email %>
Note: If you've sent us patches, bug reports, or otherwise contributed to
Logstash, and you aren't on the list above and want to be, please let us know
and we'll make sure you're here. Contributions from folks like you are what make
open source awesome.

View file

@ -0,0 +1,2 @@
# logstash-output-<%= plugin_name %>
Example output plugin. This should help bootstrap your effort to write your own output plugin!

View file

@ -0,0 +1,3 @@
source 'https://rubygems.org'
gemspec

View file

@ -0,0 +1,11 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -0,0 +1,86 @@
# Logstash Plugin
This is a plugin for [Logstash](https://github.com/elastic/logstash).
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
## Documentation
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/).
- For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
- For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
## Need Help?
Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
## Developing
### 1. Plugin Developement and Testing
#### Code
- To get started, you'll need JRuby with the Bundler gem installed.
- 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).
- Install dependencies
```sh
bundle install
```
#### Test
- Update your dependencies
```sh
bundle install
```
- Run tests
```sh
bundle exec rspec
```
### 2. Running your unpublished Plugin in Logstash
#### 2.1 Run in a local Logstash clone
- Edit Logstash `Gemfile` and add the local plugin path, for example:
```ruby
gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
```
- Install plugin
```sh
bin/logstash-plugin install --no-verify
```
- Run Logstash with your plugin
```sh
bin/logstash -e 'filter {awesome {}}'
```
At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
#### 2.2 Run in an installed Logstash
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:
- Build your plugin gem
```sh
gem build logstash-filter-awesome.gemspec
```
- Install the plugin from the Logstash home
```sh
bin/logstash-plugin install /your/local/plugin/logstash-filter-awesome.gem
```
- Start Logstash and proceed to test the plugin
## Contributing
All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.
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.
It is more important to the community that you are able to contribute.
For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.

View file

@ -0,0 +1 @@
require "logstash/devutils/rake"

View file

@ -0,0 +1,17 @@
# encoding: utf-8
require "logstash/outputs/base"
require "logstash/namespace"
# An <%= plugin_name %> output that does nothing.
class LogStash::Outputs::<%= classify(plugin_name) %> < LogStash::Outputs::Base
config_name "<%= plugin_name %>"
public
def register
end # def register
public
def receive(event)
return "Event received"
end # def event
end # class LogStash::Outputs::<%= classify(plugin_name) %>

View file

@ -0,0 +1,24 @@
Gem::Specification.new do |s|
s.name = 'logstash-output-<%= plugin_name %>'
s.version = '0.1.0'
s.licenses = ['Apache License (2.0)']
s.summary = 'TODO: Write a short summary, because Rubygems requires one.'
s.description = 'TODO: Write a longer description or delete this line.'
s.homepage = 'TODO: Put your plugin's website or public repo URL here.'
s.authors = ['<%= author %>']
s.email = '<%= email %>'
s.require_paths = ['lib']
# Files
s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
# Tests
s.test_files = s.files.grep(%r{^(test|spec|features)/})
# Special flag to let us know this is actually a logstash plugin
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "output" }
# Gem dependencies
s.add_runtime_dependency "logstash-core-plugin-api", "~> <%= min_version %>"
s.add_runtime_dependency "logstash-codec-plain"
s.add_development_dependency "logstash-devutils"
end

View file

@ -0,0 +1,22 @@
# encoding: utf-8
require "logstash/devutils/rspec/spec_helper"
require "logstash/outputs/<%= plugin_name %>"
require "logstash/codecs/plain"
require "logstash/event"
describe LogStash::Outputs::<%= classify(plugin_name) %> do
let(:sample_event) { LogStash::Event.new }
let(:output) { LogStash::Outputs::<%= classify(plugin_name) %>.new }
before do
output.register
end
describe "receive message" do
subject { output.receive(sample_event) }
it "returns a string" do
expect(subject).to eq("Event received")
end
end
end

View file

@ -0,0 +1,20 @@
require "erb"
module LogStash::PluginManager
class RenderContext
def initialize(options = {})
options.each do |name, value|
define_singleton_method(name) { value }
end
end
def get_binding
binding()
end
def classify(klass_name)
klass_name.split(/-|_/).map { |e| e.capitalize }.join("")
end
end
end

View file

@ -0,0 +1,53 @@
# Encoding: utf-8
require_relative "../spec_helper"
require "fileutils"
describe "bin/logstash-plugin generate" do
shared_examples "bin/logstash-plugin generate" do
let(:plugin_name) { "dummy" }
let(:full_plugin_name) { "logstash-#{plugin_type}-#{plugin_name}" }
describe "plugin creation" do
before(:each) do
FileUtils.rm_rf(full_plugin_name)
end
after(:each) do
FileUtils.rm_rf(full_plugin_name)
end
it "generate a new plugin" do
result = command("bin/logstash-plugin generate --type #{plugin_type} --name #{plugin_name}")
expect(result.exit_status).to eq(0)
expect(result.stdout).to match(/Creating #{full_plugin_name}/)
expect(Dir.exist?("#{full_plugin_name}")).to eq(true)
end
it "raise an error if the plugin is already generated" do
command("bin/logstash-plugin generate --type #{plugin_type} --name #{plugin_name}")
result = command("bin/logstsh-plugin generate --type #{plugin_type} --name #{plugin_name}")
expect(result.exit_status).to eq(1)
end
end
end
describe "bin/logstash-plugin generate input" do
it_behaves_like "bin/logstash-plugin generate" do
let(:plugin_type) { "input" }
end
end
describe "bin/logstash-plugin generate filter" do
it_behaves_like "bin/logstash-plugin generate" do
let(:plugin_type) { "filter" }
end
end
describe "bin/logstash-plugin generate output" do
it_behaves_like "bin/logstash-plugin generate" do
let(:plugin_type) { "output" }
end
end
end