Low commit activity in last 3 years
No release in over a year
Event support for Logstash plugins
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Event Support Mixin

Build Status

Usage

  1. Add this gem as a runtime dependency of your Logstash plugin's gemspec:

    Gem::Specification.new do |s|
      # ...
    
      s.add_runtime_dependency 'logstash-mixin-event_support'
    end
  2. In your plugin code, require this library and include it into your plugin class that already inherits LogStash::Plugin:

    require 'logstash/plugin_mixins/event_support/event_factory_adapter'
    
    class LogStash::Codecs::Bar < Logstash::Codecs::Base
    
      include LogStash::PluginMixins::EventSupport::EventFactoryAdapter
    
      # an optional mixin to provide `events_from_json` using the factory :
      #include LogStash::PluginMixins::EventSupport::FromJsonHelper
    
      def decode(data, &block)
        payload = extract_bar(data) # ...
        yield event_factory.new_event(payload)
      end
    
      # def extract_bar(data) ...
    
    end

Development

This gem:

  • MUST remain API-stable at 1.x
  • MUST NOT introduce additional runtime dependencies