<p>I'm a bit of a noob when it comes to Openshift/Kubernetes, so I hope that I can explain my use case well enough.</p>

<p>I have a Docker image of a small "program", it can be summarised as the following: it tails -f a log file, and when something that matches a regex specified in config is found, it sends an email to someone. Something like monitoring a production log of an application and sending an email with a stacktrace to the Ops team if one is printed in the application log.</p>

<p>This works fine when my application log is produced via let's say a Java EE on Weblogic app running on the host, or a log produced by another docker container but saved to a bind mounted filesystem, therefore accessible (if mounted) by the "monitoring" container.</p>

<p>Now I need to deploy this image to monitor 2-3 microservices running in Openshift. These microservices log to stdout, and I do not have privileges to mount a path owned by root like /var/lib/docker/containers/[container-id]/[container-id]-json.log to the "monitoring" container.</p>

<p>What is the best way to be able to parse the microservices logs? I am allowed to change their logback config to have them log to stdout AND to an emptyDir volume for example, and create a Pod with the microservice+volume+monitoring container.</p>

<p>Thank you everyone for your suggestions,
Roberto</p>

Roberto
<p>There's fluentd for Docker as log agreggator. However, you cannot install only fluentd with openshift's ansible installer (see <a href="https://docs.openshift.com/container-platform/3.11/install_config/aggregate_logging.html#deploying-the-efk-stack" rel="nofollow noreferrer">deploying-efk</a>). You can install fluentd logging driver on docker host manually (see <a href="https://docs.docker.com/config/containers/logging/fluentd/" rel="nofollow noreferrer">fluentd-logging-driver</a>). <a href="https://www.fluentd.org/guides/recipes/docker-logging" rel="nofollow noreferrer">There</a>'s 'getting started' about docker host configuration.
Then you can use any <a href="https://www.fluentd.org/plugins/all#input-output" rel="nofollow noreferrer">output plugin</a> to store logs</p>
