<p>I have a Fluentd running as <code>DaemonSet</code> in my Kubernetes cluster. Multiple applications are deployed in the form of microservices on the cluster spanned across namespaces by the same name as microservice name.</p>
<p>A microservice (By the name <code>payments</code>) outputs logs to <code>stdout</code>. I want to parse that microservice logs and put to some destination in Fluentd. The problem is that I want that specific microservice <code>payments</code> logs only. If I use:</p>
<pre><code>&lt;source&gt;
  @type tail
  @id in_tail_container_logs
  path /var/log/containers/*.log
  pos_file /var/log/fluentd-containers.log.pos
  tag kubernetes.*
  read_from_head true
  ....
&lt;/source&gt;
</code></pre>
<p>It will scan all pods that output logs to <code>stdout</code> I want to filter that specific microservice logs. Is there a way we can do this in Fluentd? Thanks</p>

Janshair Khan
<p>each Pod creates a log file in containers directory at <code>/var/lib/docker/containers</code></p>
<p>it should have a matching log file in containers folder, for example if your deployment start with name <code>payments</code>, we can capture log of that particular service by providing</p>
<pre><code>path /var/log/containers/payments*.log
</code></pre>
<p>in</p>
<pre><code>&lt;source&gt;
  ....
  path /var/log/containers/payments*.log
  ....
&lt;/source&gt;
</code></pre>
