# Is it possible to make a gem be used as an input and output plugin?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-make-a-gem-be-used-as-an-input-and-output-plugin/120195>\
**Category:** Logstash\
**Created:** [February 16, 2018, 2:23pm UTC](https://discuss.elastic.co/t/is-it-possible-to-make-a-gem-be-used-as-an-input-and-output-plugin/120195 "2018-02-16T14:23:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![smbullet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smbullet/32/27833_2.png) [@smbullet](https://discuss.elastic.co/u/smbullet)\
**Post date:** [February 16, 2018, 2:23pm UTC](https://discuss.elastic.co/t/is-it-possible-to-make-a-gem-be-used-as-an-input-and-output-plugin/120195/1 "2018-02-16T14:23:37Z")

</div>

I'm trying to debug a plugin that's attempting to sublcass LogStash::Outputs::ElasticSearch and overrides the submit() method. It also tries to act as an input plugin and overrides the run() method so it can feed events back into the queue. I added a log at the beginning of run() and it seems that it's never being called when I start logstash. The class is declared as:

```
class LogStash::Outputs::MyDedup < LogStash::Outputs::ElasticSearch

```

And lib/logstash\_registry.rb contains:

```
require 'logstash/plugins/registry'
require 'logstash/outputs/elasticsearch'
require 'logstash/outputs/mydedup'

LogStash::Inputs.const_set 'MyDedup', LogStash::Outputs::MyDedup

```

I honestly have no idea what's going on in the logstash\_registry.rb. Should this work? Thanks!

---

<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:** [March 16, 2018, 2:23pm UTC](https://discuss.elastic.co/t/is-it-possible-to-make-a-gem-be-used-as-an-input-and-output-plugin/120195/2 "2018-03-16T14:23:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
