# Reduce the metadata generated by filebeat while pulling logs in Kubernetes

**URL:** <https://discuss.elastic.co/t/reduce-the-metadata-generated-by-filebeat-while-pulling-logs-in-kubernetes/303267>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 26, 2022, 10:53am UTC](https://discuss.elastic.co/t/reduce-the-metadata-generated-by-filebeat-while-pulling-logs-in-kubernetes/303267 "2022-04-26T10:53:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prity-k](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prity-k/32/104842_2.png) [@prity-k](https://discuss.elastic.co/u/prity-k)\
**Post date:** [April 26, 2022, 10:53am UTC](https://discuss.elastic.co/t/reduce-the-metadata-generated-by-filebeat-while-pulling-logs-in-kubernetes/303267/1 "2022-04-26T10:53:23Z")

</div>

I am using filebeat(v 8.1.0) to pull logs from microservices deployed in kubernetes env. Right now, there is a huge amount of meta data generated by filebeat apart from the actual log message. Is there a way cut it sort to only log message and the source pod/app?

```auto
filebeat.autodiscover:
      providers:
        - type: kubernetes
          node: ${NODE_NAME}
          templates:
            - condition:
                contains:
                  kubernetes.container.name: "my-api"
              config:
                - type: container
                  paths:
                    - "/var/log/containers/*-${data.kubernetes.container.id}.log"
                  json.keys_under_root: true
                  json.message_key: message

    processors:
      - drop_event:
          when:
            contains:
              message: "/health_check HTTP/"
      - drop_fields:
          fields: ["kubernetes.labels.pod-template-hash", "kubernetes.replicaset.name", "kubernetes.node", "log","ecs", "agent.type", "agent.hostname", "agent.ephemeral_id", "agent.id", "kubernetes.namespace_uid", "kubernetes.namespace_labels"]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 24, 2022, 12:53pm UTC](https://discuss.elastic.co/t/reduce-the-metadata-generated-by-filebeat-while-pulling-logs-in-kubernetes/303267/2 "2022-05-24T12:53:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
