Skip to content
forked from 42wim/rl

Rate limit from stdin to stdout (drop or keep messages)

License

Notifications You must be signed in to change notification settings

mendix/mendix-logfilter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mendix-logfilter

This is based on https://github.com/42wim/rl.

Rate limit messages from stdin or read from a file. (keep or drop those exceeding the limit)

Use case

  • When logging it can be convenient to limit the amount of data that can be sent.

Building

Go 1.6+ is required. Make sure you have Go properly installed, including setting up your [GOPATH] (https://golang.org/doc/code.html#GOPATH )

$ make

or build with a specific version of golang:

$ docker run --rm -it -v "$PWD":/build -w /build golang:1.9-stretch make

Usage

Usage of ./mendix-logfilter:
  -f string
        define a file as input
  -k    keep the messages instead of dropping them
  -r int
        limit to r messages per second (drops those exceeding the limit) (default 5)


(the number of dropped messages will be sent to stderr, when not using the -k switch)

Examples

tail -f runtime.log | mendix-logfilter -k -r 5
mkfifo fifo.log
mendix-logfilter -k -r 5 -f fifo.log
cat runtime.log > fifo.log

About

Rate limit from stdin to stdout (drop or keep messages)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 74.3%
  • Makefile 25.7%