pub

Pipe stdin to a redis pub/sub channel

Latest on Hackage:3.0.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD-3-Clause licensed and maintained by Parnell Springmeyer

pub is an executable for piping data from stdin to a specified Redis pub/sub channel.

A typical use for this tool is to tail a log file, match a specific line with grep, and pipe it into Redis where multiple consumers can do something different with each incoming log line:

tail -F /var/log/somelogfile.log | grep "tracker.gps.parsed" | pub loglines

It also comes with a utility named sub for piping from a Redis pub/sub channel to stdout:

sub loglines | grep "somemsg"