# How to customize the exported fields?

**URL:** <https://discuss.elastic.co/t/how-to-customize-the-exported-fields/330240>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 18, 2023, 4:59pm UTC](https://discuss.elastic.co/t/how-to-customize-the-exported-fields/330240 "2023-04-18T16:59:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matheuscirillo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matheuscirillo/32/118538_2.png) [@matheuscirillo](https://discuss.elastic.co/u/matheuscirillo)\
**Post date:** [April 18, 2023, 4:59pm UTC](https://discuss.elastic.co/t/how-to-customize-the-exported-fields/330240/1 "2023-04-18T16:59:01Z")

</div>

I have a very basic `filebeats.yml` configuration file:

```auto
filebeat:
  inputs:
  - type: filestream
    id: my-log-stream
    paths:
      - /path/to/application/logs/*.log
    json:
      keys_under_root: true
      add_error_key: true
output:
  elasticsearch:
    hosts: ["https://...."]
    username: "xxx"
    password: "xxx"
    index: "voucher-app-logs-%{[agent.version]}-%{+yyyy.MM.dd}"
setup:
  template:
    name: "voucher-app-logs"
    pattern: "voucher-app-logs-*"

```

When filebeat start to forward logs to elasticsearch, it creates a datastream called `voucher-app-logs-8.7.0-2023.04.18` and then an index called `.ds-voucher-app-logs-8.7.0-2023.04.18-2023.04.18-000001`.

If I inspect the index:

```sh
curl --location --request GET 'https://my-elasticsearch-domain.com/.ds-voucher-app-logs-8.7.0-2023.04.18-2023.04.18-000001'

```

I found that it contains many, many, many properties. If I get a document, there are much less fields, because most of the fields are not sent from filebeat to elasticsearch, but they are mapped in the index.

I want just a very little subset of the fields to be mapped in the index.

I saw in the docs that I can do this by creating a custom `fields.yml` file and point to this file in my configuration, but is this the only way?

---

<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 16, 2023, 6:59pm UTC](https://discuss.elastic.co/t/how-to-customize-the-exported-fields/330240/2 "2023-05-16T18:59:25Z")

</div>

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