# Custom filter plugin creation error: logstash

**URL:** https://discuss.elastic.co/t/custom-filter-plugin-creation-error-logstash/80128
**Category:** Logstash
**Created:** [March 27, 2017, 12:11pm UTC](https://discuss.elastic.co/t/custom-filter-plugin-creation-error-logstash/80128 "2017-03-27T12:11:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vaishnavi](https://avatars.discourse-cdn.com/v4/letter/v/f19dbf/32.png) [@vaishnavi](https://discuss.elastic.co/u/vaishnavi)
#### Post date: [March 27, 2017, 12:11pm UTC](https://discuss.elastic.co/t/custom-filter-plugin-creation-error-logstash/80128/1 "2017-03-27T12:11:47Z")

</div>

Hi

I need to create a custom filter plugin in logstash to create new ruby events...

bundle install was success but while running bundle exec rspec, I get the following errors

you might need to reinstall the gem which depends on the missing jar or in case there is Jars.lock then resolve the jars with `lock_jars` command

> no such file to load -- org/apache/logging/log4j/log4j-core/2.6.2/log4j-core-2.6.2 (LoadError)  
> do\_require at /usr/local/rvm/gems/jruby-1.7.25/gems/jar-dependencies-0.3.11/lib/jar\_dependencies.rb:348  
> require\_jar at /usr/local/rvm/gems/jruby-1.7.25/gems/jar-dependencies-0.3.11/lib/jar\_dependencies.rb:255  
> require\_jar\_with\_block at /usr/local/rvm/gems/jruby-1.7.25/gems/jar-dependencies-0.3.11/lib/jar\_dependencies.rb:0  
> require\_jar at /usr/local/rvm/gems/jruby-1.7.25/gems/jar-dependencies-0.3.11/lib/jar\_dependencies.rb:254  
> require\_jar at /usr/local/rvm/gems/jruby-1.7.25/gems/jar-dependencies-0.3.11/lib/jar\_dependencies.rb:357  
> (root) at /usr/local/rvm/gems/jruby-1.7.25/gems/logstash-core-5.2.1-java/lib/logstash-core\_jars.rb:13  
> require at org/jruby/RubyKernel.java:1040  
> (root) at /usr/local/rvm/gems/jruby-1.7.25/gems/logstash-core-5.2.1-java/lib/logstash-core/logstash-core.rb:1  
> require at org/jruby/RubyKernel.java:1040  
> (root) at /usr/local/rvm/gems/jruby-1.7.25/gems/logstash-core-5.2.1-java/lib/logstash-core/logstash-core.rb:8  
> require at org/jruby/RubyKernel.java:1040  
> (root) at /usr/local/rvm/gems/jruby-1.7.25/gems/logstash-core-5.2.1-java/lib/logstash-core.rb:1  
> require at org/jruby/RubyKernel.java:1040  
> (root) at /usr/local/rvm/gems/jruby-1.7.25/gems/logstash-core-5.2.1-java/lib/logstash-core.rb:1  
> require at org/jruby/RubyKernel.java:1040  
> (root) at /usr/local/rvm/gems/jruby-1.7.25/gems/logstash-devutils-1.3.1-java/lib/logstash/devutils/rspec/spec\_helper.rb:1  
> load at org/jruby/RubyKernel.java:1059  
> (root) at /usr/local/rvm/gems/jruby-1.7.25/gems/logstash-devutils-1.3.1-java/lib/logstash/devutils/rspec/spec\_helper.rb:15  
> each at org/jruby/RubyArray.java:1613  
> (root) at /logstash-filter-example/spec/spec\_helper.rb:1  
> (root) at /logstash-filter-example/spec/spec\_helper.rb:2  
> (root) at /logstash-filter-example/spec/filters/example\_spec.rb:1  
> (root) at /logstash-filter-example/spec/filters/example\_spec.rb:2  
> (root) at /usr/local/rvm/gems/jruby-1.7.25/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1  
> load\_spec\_files at /usr/local/rvm/gems/jruby-1.7.25/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1435  
> load at org/jruby/RubyKernel.java:1059  
> load\_spec\_files at /usr/local/rvm/gems/jruby-1.7.25/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1433  
> eval at org/jruby/RubyKernel.java:1079  
> (root) at /usr/local/rvm/gems/jruby-1.7.25/bin/jruby\_executable\_hooks:15

And doing lock\_jars , I get the following error

> [ERROR] [ERROR] Some problems were encountered while processing the POMs:  
> [FATAL] Non-parseable POM /usr/local/rvm/gems/jruby-1.7.25/gems/jar-dependencies-0.3.11/lib/jars/lock\_down\_pom.rb: only whitespace content allowed before start tag and not # (position: START\_DOCUMENT seen #... @1:1) @ line 1, column 1  
> @  
> [ERROR] The build could not read 1 project -\> [Help 1]  
> [ERROR]  
> [ERROR] The project (/usr/local/rvm/gems/jruby-1.7.25/gems/jar-dependencies-0.3.11/lib/jars/lock\_down\_pom.rb) has 1 error  
> [ERROR] Non-parseable POM /usr/local/rvm/gems/jruby-1.7.25/gems/jar-dependencies-0.3.11/lib/jars/lock\_down\_pom.rb: only whitespace content allowed before start tag and not # (position: START\_DOCUMENT seen #... @1:1) @ line 1, column 1 -\> [Help 2]  
> [ERROR]  
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.  
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.  
> [ERROR]  
> [ERROR] For more information about the errors and possible solutions, please read the following articles:  
> [ERROR] [Help 1] [ProjectBuildingException - Apache Maven - Apache Software Foundation](http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException)  
> [ERROR] [Help 2] [ModelParseException - Apache Maven - Apache Software Foundation](http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException)

Is there any other dependency to install logstash filter plugin

My jruby version

> jruby 1.7.25 (1.9.3p551) 2016-04-13 867cb81 on Java HotSpot(TM) 64-Bit Server VM 1.8.0\_111-b14 +jit [linux-amd64]

I am using centos 7

Any help would be appreciated

---

<div class="post-metadata">

### Author: ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)
#### Post date: [March 31, 2017, 1:36pm UTC](https://discuss.elastic.co/t/custom-filter-plugin-creation-error-logstash/80128/2 "2017-03-31T13:36:05Z")

</div>

Hello,  
I presume you did use our plugin generator or the example repo to bootstrap your plugin?  
From the error, I believe the `spec_helper` in your project is missing a require.

Can you check if the first line in your spec\_helper is this line? If its not can you add it?

```auto
require "logstash/devutils/rspec/spec_helper"

```

Thanks

---

<div class="post-metadata">

### Author: ![vaishnavi](https://avatars.discourse-cdn.com/v4/letter/v/f19dbf/32.png) [@vaishnavi](https://discuss.elastic.co/u/vaishnavi)
#### Post date: [April 4, 2017, 1:44pm UTC](https://discuss.elastic.co/t/custom-filter-plugin-creation-error-logstash/80128/3 "2017-04-04T13:44:57Z")

</div>

Thanks

And I got the solution by installing maven and install JARS\_DEPENDENCY gem by using JARS\_DEBUG=true

---

<div class="post-metadata">

### Author: ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)
#### Post date: [April 7, 2017, 1:29pm UTC](https://discuss.elastic.co/t/custom-filter-plugin-creation-error-logstash/80128/4 "2017-04-07T13:29:45Z")

</div>


