<p>It seems that excluding logs in a pod using the configuration below does not work.</p>
<p>extrascrapeconfig.yaml:</p>
<pre><code> - job_name: kubernetes-pods-app
   pipeline_stages:
   - docker: {}
   kubernetes_sd_configs:
   - role: pod
   relabel_configs:
   - action: drop
     regex: .+
     source_labels:
      - __meta_kubernetes_pod_label_name
    ###
   - action: keep
     regex: ambassador
     source_labels:
      - __meta_kubernetes_namespace
      - __meta_kubernetes_pod_namespace
      ###
</code></pre>
<h2>To Reproduce</h2>
<p>Steps to reproduce the behavior:</p>
<p>Deployed helm loki-stack :</p>
<pre><code>helm install loki grafana/loki-stack --version &quot;${HELM_CHART_VERSION}&quot; \
  --namespace=monitoring \
  --create-namespace \
  -f &quot;loki-stack-values-v${HELM_CHART_VERSION}.yaml&quot;
</code></pre>
<p><strong>loki-stack-values-v2.4.1.yaml:</strong></p>
<pre><code>loki:
  enabled: true
  config:


promtail:
  enabled: true
  extraScrapeConfigs: extrascrapeconfig.yaml

fluent-bit:
  enabled: false

grafana:
  enabled: false

prometheus:
  enabled: false


</code></pre>
<p>Attach grafana to loki datasource</p>
<p>Query: {namespace=&quot;kube-system&quot;} in Grafana Loki</p>
<p><strong>RESULT:</strong></p>
<p><strong>See logs</strong></p>
<p><strong>Expected behavior:</strong></p>
<p>Not seeing any logs</p>
<p>Environment:</p>
<p>Infrastructure: Kubernetes<br />
Deployment tool: Helm</p>
<p>What am I missing?</p>

<p>If you need Helm to pick up a specific file and pass it as a value, you should not pass the value itself in the values YAML file, but via another flag when installing or upgrading the release.</p>
<p>The command you are using is just applying the Helm values as-is, since the <code>-f</code> flag does not support parsing other files into the values by itself. Instead, use <code>--set-file</code>, which works similarly to <code>--set</code>, but gets the value content from the passed file.</p>
<p>Your command would now look like this:</p>
<pre><code>    helm install loki grafana/loki-stack --version &quot;${HELM_CHART_VERSION}&quot; \
  --namespace=monitoring \
  --create-namespace \
  -f &quot;loki-stack-values-v${HELM_CHART_VERSION}.yaml&quot; \
  --set-file promtail.extraScrapeConfigs=extrascrapeconfig.yaml
</code></pre>
