Skip to content

kelvinfann/logstash-filter-esleep

 
 

Repository files navigation

#Logstash Plugin Filter - ESleep

This is a throttling plugin for logstash. It will force logstash to sleep for a specified amount of time after either a) processing a certain number of messages or b) spending a certain amount of time processing those messages

Following the lead of LogStash, this plugin is completely free and fully open source. The license is Apache 2.0 (I think?).

##Disclaimer

This plugin is essentially a stripped down and modified version of the LogStash plugin sleep.

If you read through the code, it copies large portions of code from the metric code; I do not claim to be the author of alot of the code. I simply jury-rigged the metrics plugin code to fit my usecase to run some tests. I do not believe I violate any of the licenses of the plugin/lib, but if either parties are upset, feel free to email me. I only put this up because I figured some other user might also need to have use for what I wrote

##Credit This plugin utilizes the following libraries:

##Install You install this plugin as you would install all logstash plugins. Here is a guide Use the test installation

##Config

Esleep is, in many ways, a simplified version of the sleep plugin. The configs that should concern you are:

  • sleeptime: the amount of time you want to sleep the logstash process
  • every: the number of messages to process before sleeping
  • timelimit: forces sleep after a certain amount of elapsed time if hasn't reached the 'every' amount of messages

##Example

Simple stdin/out example

logstash config:

input{
	stdin{}
}
filter{
	esleep{
		sleeptime => 1 # Sleep 1 second
		every => 10 # on every 10th event
		timelimit => 20 # or when 20 seconds has elapsed. Which ever first
	}
}
output{
	stdout{}
}

Note that after the logstash process sleeps the every and timelimit are both reset.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%