logspout
logspout copied to clipboard
Multiple values for filter.name
Is it possible to pass multiple container name patterns on filter.name ?
It doesn't seem like it:
syslog+tcp://localhost:7651?filter.name=boring_dijkstra%2Cvigorous_haibt
Only seems to send logs for the first container in the list.
The only example is this:
raw://192.168.10.10:5000?filter.name=*_db
Does this mean it supports all regular expressions? Or just simple pattern-matching? Clearer documentation would be a big help here.
Any news?
Actually, logspout supports several container name filters. Just use several endpoints. See example for k8s: https://github.com/gliderlabs/logspout/issues/404#issuecomment-404111589
I don't like this way — because you need to repeat endpoint details, and in general this way is very not intuitive. I even prepared PR https://gist.github.com/develar/fdba772411cb2391f466a8723982c772 but did't send it because realised that currently logspout filter.labels works in a way that container must match ALL specified label filers. As user, I expect OR, but logspout currently uses AND. Decided for now just use several endpoints.
I am going to send PR to document how to use logspout with k8s.
@develar This PR is what we want, which does not conflict with label management, and allows developers to choose which way to use, so the greatest benefit is that it does not need to change the target containers that you want to record.
@tongv As commented, nothing prevent you to use multiple file name filter, please see https://github.com/gliderlabs/logspout/issues/404#issuecomment-404111589
Example (for kubernetes (rancher 2.0), as Docker Swarm is not good for production): syslog://logsN.papertrailapp.com:N?filter.name=k8s_YOUR_CONTAINER_NAME1_*,syslog://logsN.papertrailapp.com:N?filter.name=k8s_YOUR_CONTAINER_NAME2_*