from multiple sources to multiple destinations using s6-log

From: Gorka Lertxundi <glertxundi_at_gmail.com>
Date: Wed, 18 Feb 2015 00:12:12 -0800 (PST)

Hi guys,


I was trying to get my head around on how to provide multiple s6-log ‘watches’ for a single supervised process.


Imagine I have a single process which generates multiple kind of logs, for example, nginx, or even better mysql, which could generate three types of logs: general, error and slow-query. Piping all of them to the same destination in order to be eatable by s6-log, will converge typologies into one log processing chain.


Is it possible, somehow, create a multiplexer in order to know the source and then redirect to whatever destination I consider suitable?


I came across with a solution:


general   -> /dev/mypipe1 (prepend “g:”)  --\                 /-- if g  s6-log /generalpath
error     -> /dev/mypipe2 (prepend “e:”)  ---|— /dev/stdout -|--- if e  s6-log /errorpath
slow-quey -> /dev/mypipe3 (prepend “sq:”) --/                 \-- if sq s6-log /slow-query


But probably a better solution could be achieved and you already know how to solve this kind of problems. Is there any “best pattern” for this?


Thanks in advance,
Received on Wed Feb 18 2015 - 08:12:12 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC