# Custom filters are not working with Logstash-5.0.0

**URL:** https://discuss.elastic.co/t/custom-filters-are-not-working-with-logstash-5-0-0/65057
**Category:** Logstash
**Created:** [November 4, 2016, 8:08pm UTC](https://discuss.elastic.co/t/custom-filters-are-not-working-with-logstash-5-0-0/65057 "2016-11-04T20:08:11Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![er.ashish1500](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@er.ashish1500](https://discuss.elastic.co/u/er.ashish1500)
#### Post date: [November 4, 2016, 8:08pm UTC](https://discuss.elastic.co/t/custom-filters-are-not-working-with-logstash-5-0-0/65057/1 "2016-11-04T20:08:11Z")

</div>

I am new for logstash 5.0 and tried to create custom filter at 'PATH/logstash/filters/global\_config.rb' with the name of global config but I am getting error as:  
bin/logstash -f conf\_d/  
Sending Logstash logs to /usr/local/seceon/ashish/logstash-5.0.0/logs which is now configured via log4j2.properties.  
[2016-11-04T15:41:44,592][ERROR][logstash.agent] fetched an invalid config {:config=\>"input { stdin { } }\n\nfilter {\n grok {\n match =\> { "message" =\> "%{COMBINEDAPACHELOG}" }\n }\n date {\n match =\> ["timestamp" , "dd/MMM/yyyy:HH:mm:ss Z"]\n }\n global\_config {\n }\n}\n\noutput {\n elasticsearch { hosts =\> ["localhost:9200"] }\n stdout { codec =\> rubydebug }\n}\n\n", :reason=\>"Couldn't find any filter plugin named 'global\_config'. Are you sure this is correct? Trying to load the global\_config filter plugin resulted in this error: LoadError"}

I don't know what's I am doing wrong here can someone please help me ?

Same global-config.rb is working fine with logstash-2.4.0

---

<div class="post-metadata">

### Author: ![er.ashish1500](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@er.ashish1500](https://discuss.elastic.co/u/er.ashish1500)
#### Post date: [November 4, 2016, 8:36pm UTC](https://discuss.elastic.co/t/custom-filters-are-not-working-with-logstash-5-0-0/65057/2 "2016-11-04T20:36:04Z")

</div>

I tried to copy mutate.rb and renamed it as mutate\_1.rb getting this error

[2016-11-04T16:32:53,500][DEBUG][logstash.plugin] Problems loading the plugin with {:type=\>"filter", :name=\>"mutate\_1", :path=\>"logstash/filters/mutate\_1"}  
[2016-11-04T16:32:53,509][ERROR][logstash.agent] fetched an invalid config {:config=\>"input { stdin { } }\n\nfilter {\n grok {\n match =\> { "message" =\> "%{COMBINEDAPACHELOG}" }\n }\n date {\n match =\> ["timestamp" , "dd/MMM/yyyy:HH:mm:ss Z"]\n }\n mutate\_1 {\n }\n}\n\noutput {\n elasticsearch { hosts =\> ["localhost:9200"] }\n stdout { codec =\> rubydebug }\n}\n\n", :reason=\>"Couldn't find any filter plugin named 'mutate\_1'. Are you sure this is correct? Trying to load the mutate\_1 filter plugin resulted in this error: LoadError", :backtrace=\>["/usr/local/seceon/ashish/logstash-5.0.0/logstash-core/lib/logstash/plugin.rb:127:in `lookup'", "/usr/local/seceon/ashish/logstash-5.0.0/logstash-core/lib/logstash/pipeline.rb:413:in`plugin'", "(eval):64:in `initialize'", "org/jruby/RubyKernel.java:1079:in`eval'", "/usr/local/seceon/ashish/logstash-5.0.0/logstash-core/lib/logstash/pipeline.rb:90:in `initialize'", "/usr/local/seceon/ashish/logstash-5.0.0/logstash-core/lib/logstash/agent.rb:195:in`create\_pipeline'", "/usr/local/seceon/ashish/logstash-5.0.0/logstash-core/lib/logstash/agent.rb:87:in `register_pipeline'", "/usr/local/seceon/ashish/logstash-5.0.0/logstash-core/lib/logstash/runner.rb:258:in`execute'", "/usr/local/seceon/ashish/logstash-5.0.0/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'", "/usr/local/seceon/ashish/logstash-5.0.0/logstash-core/lib/logstash/runner.rb:174:in`run'", "/usr/local/seceon/ashish/logstash-5.0.0/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'", "/usr/local/seceon/ashish/logstash-5.0.0/lib/bootstrap/environment.rb:68:in`(root)'"]}

---

<div class="post-metadata">

### Author: ![w0lverine](https://avatars.discourse-cdn.com/v4/letter/w/90db22/32.png) [@w0lverine](https://discuss.elastic.co/u/w0lverine)
#### Post date: [November 7, 2016, 3:04pm UTC](https://discuss.elastic.co/t/custom-filters-are-not-working-with-logstash-5-0-0/65057/3 "2016-11-07T15:04:59Z")

</div>

You have an odd number of brackets in the error report. So check your config file and make sure you have properly placed the brackets correctly and didn't forget one 🙂 . Also if you can post the config file it will help.

---

<div class="post-metadata">

### Author: ![er.ashish1500](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@er.ashish1500](https://discuss.elastic.co/u/er.ashish1500)
#### Post date: [November 7, 2016, 4:07pm UTC](https://discuss.elastic.co/t/custom-filters-are-not-working-with-logstash-5-0-0/65057/4 "2016-11-07T16:07:51Z")

</div>

Thanks for reply..

I have a very small config with input/filter/output .  
This is the config file  
[root@cce-logs-processor logstash-5.0.0]# cat conf\_d/test.conf  
input { stdin { } }

filter {  
global\_config {  
}  
}

output {  
stdout { codec =\> rubydebug }  
}

and this is the error 🙂  
[2016-11-07T11:06:34,665][DEBUG][logstash.agent] Reading config file {:config\_file=\>"/usr/local/seceon/ashish/logstash-5.0.0/conf\_d/test.conf"}  
it's here logstash/inputs/stdin  
it's here stdin  
it's here logstash/codecs/line  
it's here line  
[2016-11-07T11:06:34,690][DEBUG][logstash.codecs.line] config LogStash::Codecs::Line/@id = "line\_b0144465-2a1e-42ac-a98d-6e521933dfda"  
[2016-11-07T11:06:34,690][DEBUG][logstash.codecs.line] config LogStash::Codecs::Line/@enable\_metric = true  
[2016-11-07T11:06:34,690][DEBUG][logstash.codecs.line] config LogStash::Codecs::Line/@charset = "UTF-8"  
[2016-11-07T11:06:34,690][DEBUG][logstash.codecs.line] config LogStash::Codecs::Line/@delimiter = "\n"  
[2016-11-07T11:06:34,692][DEBUG][logstash.inputs.stdin] config LogStash::Inputs::Stdin/@id = "a2cbc585fb561768566d789e197abb1de72fe3cb-1"  
[2016-11-07T11:06:34,692][DEBUG][logstash.inputs.stdin] config LogStash::Inputs::Stdin/@enable\_metric = true  
[2016-11-07T11:06:34,692][DEBUG][logstash.inputs.stdin] config LogStash::Inputs::Stdin/@codec = \<LogStash::Codecs::Line id=\>"line\_b0144465-2a1e-42ac-a98d-6e521933dfda", enable\_metric=\>true, charset=\>"UTF-8", delimiter=\>"\n"\>  
[2016-11-07T11:06:34,692][DEBUG][logstash.inputs.stdin] config LogStash::Inputs::Stdin/@add\_field = {}  
[2016-11-07T11:06:34,693][DEBUG][logstash.plugin] Problems loading the plugin with {:type=\>"filter", :name=\>"global\_config", :path=\>"logstash/filters/global\_config"}  
[2016-11-07T11:06:34,699][ERROR][logstash.agent] fetched an invalid config {:config=\>"input { stdin { } }\n\nfilter {\n global\_config {\n }\n}\n\noutput {\n stdout { codec =\> rubydebug }\n}\n\n", :reason=\>"Couldn't find any filter plugin named 'global\_config'. Are you sure this is correct? Trying to load the global\_config filter plugin resulted in this error: LoadError", :backtrace=\>["/usr/local/seceon/ashish/logstash-5.0.0/logstash-core/lib/logstash/plugin.rb:132:in `lookup'", "/usr/local/seceon/ashish/logstash-5.0.0/logstash-core/lib/logstash/pipeline.rb:413:in`plugin'", "(eval):12:in `initialize'", "org/jruby/RubyKernel.java:1079:in`eval'", "/usr/local/seceon/ashish/logstash-5.0.0/logstash-core/lib/logstash/pipeline.rb:90:in `initialize'", "/usr/local/seceon/ashish/logstash-5.0.0/logstash-core/lib/logstash/agent.rb:195:in`create\_pipeline'", "/usr/local/seceon/ashish/logstash-5.0.0/logstash-core/lib/logstash/agent.rb:87:in `register_pipeline'", "/usr/local/seceon/ashish/logstash-5.0.0/logstash-core/lib/logstash/runner.rb:258:in`execute'", "/usr/local/seceon/ashish/logstash-5.0.0/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'", "/usr/local/seceon/ashish/logstash-5.0.0/logstash-core/lib/logstash/runner.rb:174:in`run'", "/usr/local/seceon/ashish/logstash-5.0.0/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'", "/usr/local/seceon/ashish/logstash-5.0.0/lib/bootstrap/environment.rb:68:in`(root)'"]}

---

<div class="post-metadata">

### Author: ![kodgule](https://avatars.discourse-cdn.com/v4/letter/k/e0b2c6/32.png) [@kodgule](https://discuss.elastic.co/u/kodgule)
#### Post date: [November 8, 2016, 6:44am UTC](https://discuss.elastic.co/t/custom-filters-are-not-working-with-logstash-5-0-0/65057/5 "2016-11-08T06:44:14Z")

</div>

I see the same issue with my custom output plugin.  
Attempt to start logstash 5.0 with a custom output plugin (Ensured that I ve configured path.plugins correctly in the logstash.yml ) fails with the following error -

Trying to load the XXXXX output plugin resulted in this error: LoadError

I feel that for some reasons the register method in the plugin is not getting invoked. I debugged and see that the exception is being thrown at:  
**registry.rb:69:in `lookup'**

which means that the plugin registration indeed did not happen. And hence there is no entry for path,klass for my custom o/p plugin.  
This was working all fine until logstash 2.2.1.

I browsed through the documentation for breaking changes, and followed whatever is being asked for. However, still I see this error.  
Please note: I am not using plugin-install. I am trying to use the output plugin in a standalone fashion as a java based custom plugin.

Any help on this would be appreciated.  
Thanks!  
Yogesh

---

<div class="post-metadata">

### Author: ![er.ashish1500](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@er.ashish1500](https://discuss.elastic.co/u/er.ashish1500)
#### Post date: [November 10, 2016, 3:23pm UTC](https://discuss.elastic.co/t/custom-filters-are-not-working-with-logstash-5-0-0/65057/6 "2016-11-10T15:23:34Z")

</div>

Hi Yogesh ,  
Did you find a solution for your issue ?

---

<div class="post-metadata">

### Author: ![kodgule](https://avatars.discourse-cdn.com/v4/letter/k/e0b2c6/32.png) [@kodgule](https://discuss.elastic.co/u/kodgule)
#### Post date: [November 11, 2016, 8:48am UTC](https://discuss.elastic.co/t/custom-filters-are-not-working-with-logstash-5-0-0/65057/7 "2016-11-11T08:48:51Z")

</div>

Nothing yet Ashish.  
Actually, I haven't put more efforts on this after this post, as I think I am blocked on this.

Can some logstash SMEs please help us out here?

---

<div class="post-metadata">

### Author: ![kodgule](https://avatars.discourse-cdn.com/v4/letter/k/e0b2c6/32.png) [@kodgule](https://discuss.elastic.co/u/kodgule)
#### Post date: [December 5, 2016, 8:23am UTC](https://discuss.elastic.co/t/custom-filters-are-not-working-with-logstash-5-0-0/65057/8 "2016-12-05T08:23:20Z")

</div>

Is this an Issue with Logstash 5.0?  
If so, when can we see this fixed? Any probable date /next version in which this can be seen fixed?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 4:30am UTC](https://discuss.elastic.co/t/custom-filters-are-not-working-with-logstash-5-0-0/65057/9 "2017-07-06T04:30:01Z")

</div>


