How we can create custom filter plugin in logstash?

Hello Folks,

I am using logstash 5.6.3 and I have written python script for parsing the some part of logs. i want to call this script from filter section of logstash.

I look around almost all the ways to look into it. i found a basic template structure to create plugin in logstash.

https://www.elastic.co/guide/en/logstash/current/plugin-generator.html

but it will create directory structure only for plugins. I am facing challenge to install dependency regarding this.

So i have following questions:

  1. how we can define the dependency in plugins and where i have to register those dependency entry ?
  2. how we can test this with logstash base functionality ?
  3. how to build final gem file to install this plugin into logstash ?

I will appreciate if someone can share some sample in this scenario.

I think you'll answers to most of your questions in https://www.elastic.co/guide/en/logstash/current/_how_to_write_a_logstash_filter_plugin.html.

  1. The .gemspec file lists dependencies.
  2. Write specs for the plugin? Or install the plugin and try it out? I'm not sure I understand the question.
  3. gem build logstash-filter-whatever.gemspec

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