No commit activity in last 3 years
No release in over 3 years
A logstash filter plugin to throttle events per properties
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

Logstash Filter Throttle Prop

This is a plugin for Logstash.

It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.

The logstash-filter-throttle-prop is to throttle events per a dynamic property. The filter is configured with a key, a value and a limit. The key is used to group the values. If the values with a different content are inserted more than limit, it will be filtered.

How to install

bin/logstash-plugin install logstash-filter-throttle-prop

Hou to use

For example, if you wanted to throttle events per a property "type", and you didn't want to have more than two differents types, you would use the configuration:

filter {
  throttle_prop {
    key => "fixed_key"
    value => "%{type}"
    limit => 2
    add_tag => [ "throttled" ]
  }
}
Which would result in:
  • event 1 { type => 'a' } - not throttled
  • event 2 { type => 'a' } - not throttled
  • event 3 { type => 'b' } - not throttled
  • event 4 { type => 'b' } - not throttled
  • event 5 { type => 'c' } - throttled (successful filter)
  • event 6 { type => 'c' } - throttled (successful filter)
  • event 7 { type => 'a' } - not throttled
  • event 8 { type => 'b' } - not throttled
  • event 9 { type => 'c' } - throttled (successful filter)
  • event 10 { type => 'd' } - throttled (successful filter)

Developing

1. Plugin Developement and Testing

Code

  • To get started, you'll need JRuby with the Bundler gem installed.

  • Install dependencies

bundle install

Test

  • Update your dependencies
bundle install
  • Run tests
bundle exec rspec