syslogで受けとったメッセージをアプリケーションで直接読む

久々の更新。
man 5 rsyslog.conf

Named pipes
This version of rsyslogd(8) has support for logging output to named pipes
(fifos). A fifo or named pipe can be used as a destination for log messages
by prepending a pipe symbol (’|’) to the name of the file. This is handy for
debugging. Note that the fifo must be created with the mkfifo(1) command
before rsyslogd(8) is started.

rsylsog.confに直接コマンド書くのかなと思ったけど、そうではなくて名前付きパイプに出力するらしい。
(名前付きパイプはmkfifoで事前に作っておく)
あとはアプリケーションでその名前付きパイプを開けば良い。