redis-pipe

command module
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2015 License: MIT Imports: 8 Imported by: 0

README

redis-pipe Build Status

redis-pipe allows you to treat Redis Lists as if they were Unix pipes. It basically connects stdin and stdout with LPUSH and LPOP.

Install

Simply download the release and make it executable (prebuilt binaries are for Linux only for now).

wget https://github.com/lukasmartinelli/redis-pipe/releases/download/v1.4/redis-pipe
chmod +x redis-pipe
./redis-pipe --help

Build

Install dependencies

go get github.com/andrew-d/go-termutil
go get github.com/docopt/docopt-go
go get github.com/garyburd/redigo/redis"

Build binary

go build redis-pipe.go

How it works

Configuration

Set the REDIS_HOST and REDIS_PORT environment variables for easy configuration or pass --host and --port arguments.

Writing from stdin to Redis List

Pipe in value to redis-pipe and it will LPUSH them to the Redis List.

echo "hi there" | ./redis-pipe greetings

Write from stdin to Redis with LPUSH

Reading from Redis List to stdout

If you call redis-pipe with a tty attached it will LPOP all values from the Redis List and write them to stdout.

./redis-pipe greetings

Read from Redis with LPOP and write to stdout

You can also limit the amount of values popped from the list.

./redis-pipe --count 100 greetings

Support for blocking mode with BLPOP is not supported yet.

Examples

Centralized Logging

In this sample we pipe the syslog to a Redis List called log.

tail -f /var/log/syslog | ./redis-pipe logs

You can now easily collect all the syslogs of your machines on a single server.

./redis-pipe logs > logs.txt

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL