# Filebeat: How to export logs of specific pods

**URL:** <https://discuss.elastic.co/t/filebeat-how-to-export-logs-of-specific-pods/272444>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 7, 2021, 7:33pm UTC](https://discuss.elastic.co/t/filebeat-how-to-export-logs-of-specific-pods/272444 "2021-05-07T19:33:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vrathore18](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vrathore18/32/88411_2.png) [@vrathore18](https://discuss.elastic.co/u/vrathore18)\
**Post date:** [May 7, 2021, 7:33pm UTC](https://discuss.elastic.co/t/filebeat-how-to-export-logs-of-specific-pods/272444/1 "2021-05-07T19:33:07Z")

</div>

This is my filebeat config map.

```auto
apiVersion: v1
kind: ConfigMap
metadata:
  name: filebeat-config
  namespace: kube-system
  labels:
    k8s-app: filebeat
data:
  filebeat.yml: |-
    filebeat.inputs:
    - type: container
      paths:
        - /var/log/containers/*.log
      processors:
        - add_kubernetes_metadata:
            host: ${NODE_NAME}
            matchers:
            - logs_path:
                logs_path: "/var/log/containers/"

    setup.ilm.enabled: false
    processors:
      - add_cloud_metadata:
      - add_host_metadata:

    output.elasticsearch:
      hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
      username: ${ELASTICSEARCH_USERNAME}
      password: ${ELASTICSEARCH_PASSWORD}

```

This sends logs from every pod to AWS ElasticSearch. How I can restrict it to send logs from specific pods by name and/or by the label?

---

<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:** [June 4, 2021, 9:33pm UTC](https://discuss.elastic.co/t/filebeat-how-to-export-logs-of-specific-pods/272444/2 "2021-06-04T21:33:22Z")

</div>

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