<p>I deploy fluent bit to kubernetes. And I deploy one pod with annotation <code>fluentbit.io/parser: cri</code>. But it still parse the log with the parser <code>ivyxjc</code> which is config in <code>INPUT</code>.</p>
<p>fluent-bit config</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
    name: fluent-bit-config
    labels:
        k8s-app: fluent-bit
data:
    # Configuration files: server, input, filters and output
    # ======================================================
    fluent-bit.conf: |
        [SERVICE]
            Flush         1
            Log_Level     info
            Daemon        off
            Parsers_File  parsers.conf
            HTTP_Server   On
            HTTP_Listen   0.0.0.0
            HTTP_Port     2020

        @INCLUDE input-kubernetes.conf
        @INCLUDE filter-kubernetes.conf
        @INCLUDE output-elasticsearch.conf

    input-kubernetes.conf: |
        [INPUT]
            Name              tail
            Tag               kube.*
            Path              /var/log/containers/*.log
            Parser            ivyxjc
            DB                /var/log/flb_kube.db
            Mem_Buf_Limit     200MB
            Skip_Long_Lines   On
            Refresh_Interval  10

    filter-kubernetes.conf: |
        [FILTER]
            Name                kubernetes
            Match               kube.*
            Kube_URL            https://kubernetes.default.svc:443
            Kube_CA_File        /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
            Kube_Token_File     /var/run/secrets/kubernetes.io/serviceaccount/token
            Kube_Tag_Prefix     kube.var.log.containers.
            Merge_Log           On
            k8s-logging.parser  On
            K8S-Logging.Exclude On

    output-elasticsearch.conf: |
        [OUTPUT]
            Name            es
            Match           *
            Host            ${FLUENT_ELASTICSEARCH_HOST}
            Port            ${FLUENT_ELASTICSEARCH_PORT}
            HTTP_User       ${FLUENT_ELASTICSEARCH_USER}
            HTTP_Passwd     ${FLUENT_ELASTICSEARCH_PASSWD}
            Logstash_Format On
            Replace_Dots    On
            Retry_Limit     False
            tls             On
            tls.verify      Off

    parsers.conf: |
        [PARSER]
            # http://rubular.com/r/tjUt3Awgg4
            Name cri
            Format regex
            Regex ^(?&lt;time&gt;[^ ]+) (?&lt;stream&gt;stdout|stderr) (?&lt;logtag&gt;[^ ]*) (?&lt;message&gt;.*)$
            Time_Key    time
            Time_Format %Y-%m-%dT%H:%M:%S.%L%z

        [PARSER]
            Name ivyxjc
            Format regex
            Regex ^(?&lt;time&gt;[^ ]+) (?&lt;stream&gt;stdout|stderr) (?&lt;logtag2&gt;[^ ]*) (?&lt;message2&gt;.*)$
            Time_Key    time
            Time_Format %Y-%m-%dT%H:%M:%S.%L%z
</code></pre>
<p>Pod description:</p>
<pre><code>...
Name:         logger-5c6658b5dd-66zkw
Namespace:    logger
Priority:     0
Start Time:   Fri, 15 Oct 2021 15:28:47 +0800
Labels:       app=logger
              pod-template-hash=5c6658b5dd
Annotations:  fluentbit.io/parser: cri
              fluentbit.io/parser_stderr: cri
              fluentbit.io/parser_stdout: cri
Status:       Running
...
</code></pre>

fei_hsueh
<blockquote>
<p>k8s-logging.parser</p>
</blockquote>
<p>This option tells fluent bit agent to use parser from the annotation that will be used for the &quot;log&quot; keyword. The INPUT
parser will be applied as per usual. Afterwards &quot;KUBERNETES&quot; filter picks up the input and then the parser dictated by &quot;fluentbit.io/parser: parser_name_here&quot; will pick up values from the &quot;log&quot; keyword.</p>
<p>Reference to <a href="https://docs.fluentbit.io/manual/pipeline/filters/kubernetes#processing-the-log-value" rel="nofollow noreferrer">docs</a>.</p>
<p>Unfortunately that does not work in some cases as well, I have not been able to chase it down yet, but will update this answer if I do find something.</p>
