No release in over a year
Scheduler 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

Scheduler 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-scheduler', '~> 1.0'
    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/scheduler'
    
    class LogStash::Inputs::Bar < Logstash::Inputs::Base
    
      include LogStash::PluginMixins::Scheduler
    
      # Schedule of when to periodically run statement, in Cron format
      # for example: "* * * * *" (execute query every minute, on the minute)
      config :schedule, :validate => :string
    
      def run(queue)
        if @schedule
          scheduler.cron(@schedule) { serve_drinks(queue) }
          scheduler.join
        else
          serve_drinks(queue)
        end
      end
    
      # def server_drinks ...
    
    end

Development

This gem:

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