<p>I need to exclude the logs generated by istio's sidecar from fluentbit.
In the official documentation the only thing I managed to find regarding excluding logs from the fluentbit was an annotations in the metadata section I don't think will fit in here:</p>
<p><a href="https://docs.fluentbit.io/manual/pipeline/filters/kubernetes#kubernetes-annotations" rel="nofollow noreferrer">https://docs.fluentbit.io/manual/pipeline/filters/kubernetes#kubernetes-annotations</a></p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: apache-logs
  labels:
    app: apache-logs
  annotations:
    fluentbit.io/exclude: &quot;true&quot;
spec:
  containers:
  - name: apache
    image: edsiper/apache_logs
</code></pre>
<p>Does anyone already did that?</p>

Joao Braga
<p>If you're getting the logs from the files by using the <code>tail</code> input, you may want to rely on the <code>Exclude_Path</code> option for this: <a href="https://docs.fluentbit.io/manual/pipeline/inputs/tail" rel="nofollow noreferrer">https://docs.fluentbit.io/manual/pipeline/inputs/tail</a> .</p>
<p>In particular, if you look at the log files name, it should look like the following:</p>
<pre><code>/path-to-logs/${POD_NAME}_${NAMESPACE}_${CONTAINER_NAME}-${SOME_HASH}
</code></pre>
<p>You can probably play around with that part which has the container name. I would try something like the following:</p>
<pre><code>[INPUT]
     Name             tail
     Path             /var/log/containers/*
     Exclude_Path     /var/log/containers/*_istio-proxy*,/var/log/containers/*_istio-init*
     Parser           docker
     Tag              kube.*
     Mem_Buf_Limit    5MB
     Skip_Long_Lines  On
</code></pre>
