# Building a custom plugin

**URL:** <https://discuss.elastic.co/t/building-a-custom-plugin/26595>\
**Category:** Logstash\
**Created:** [July 30, 2015, 9:15pm UTC](https://discuss.elastic.co/t/building-a-custom-plugin/26595 "2015-07-30T21:15:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Win\_Wang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/win_wang/32/674_2.png) [@Win\_Wang](https://discuss.elastic.co/u/Win_Wang)\
**Post date:** [July 30, 2015, 9:15pm UTC](https://discuss.elastic.co/t/building-a-custom-plugin/26595/1 "2015-07-30T21:15:53Z")

</div>

Hi, I've gone through [https://www.elastic.co/guide/en/logstash/current/\_how\_to\_write\_a\_logstash\_codec\_plugin.html](https://www.elastic.co/guide/en/logstash/current/_how_to_write_a_logstash_codec_plugin.html) and found two problems.

First, when I build the gem I get the error ["git" "ls-files"] is not a file, which is true. My gemspec has s.files = 'git ls-files'.split($), as ripped from another plugin.

So I commented that line out, and the gem built. I installed the gem via plugin install /path/to/gem.gem, and it said installation successful. Unfortunately it doesn't show up when I do plugin list, and fails when I try to start a config with it.

Edit: I'm on v1.5.0

Anybody else have better luck?

---

<div class="post-metadata">

**Author:** ![eeveaud](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eeveaud/32/3601_2.png) [@eeveaud](https://discuss.elastic.co/u/eeveaud)\
**Post date:** [July 31, 2015, 8:16am UTC](https://discuss.elastic.co/t/building-a-custom-plugin/26595/2 "2015-07-31T08:16:38Z")

</div>

maybee you would like to check this post.

> [@How to debug plugin installation](https://discuss.elastic.co/t/how-to-debug-plugin-installation/25841/4):
>
> I had similar problem once. is your source code pluggin under git ? as you say that you modified the LS gem plugin I suspect that iti s not. if not gem build will create an empty data.tar.gz directory because of the following line in gemspec. # Files s.files = `git ls-files`.split($\) you can check the content of the generated gem by untaring it pluggin install won't complain if data is empty and claim "installation succesfull" either git init (best way) your source directory in order t…

---

<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, 5:33am UTC](https://discuss.elastic.co/t/building-a-custom-plugin/26595/3 "2017-07-06T05:33:13Z")

</div>


