2

What is a good way to psubscribe on a redis pattern and pipe to grep.

I tried

redis-cli psubscribe "somepattern*" | grep somevalue

But it seems to not work if the pattern doesn't publish frequently.

Drew LeSueur
  • 19,185
  • 29
  • 89
  • 106
  • Does this answer your question? [Saving filtered redis-cli output to a file](https://stackoverflow.com/questions/69691811/saving-filtered-redis-cli-output-to-a-file) – tripleee Jan 19 '23 at 13:46

1 Answers1

2

How to redirect the output of redis subscription

stdbuf -oL redis-cli psubscribe "*"  | grep --line-buffered sometext
Drew LeSueur
  • 19,185
  • 29
  • 89
  • 106