# Filter for fields that are present in Data Views

**URL:** https://discuss.elastic.co/t/filter-for-fields-that-are-present-in-data-views/363685
**Category:** Kibana
**Created:** [July 24, 2024, 8:50am UTC](https://discuss.elastic.co/t/filter-for-fields-that-are-present-in-data-views/363685 "2024-07-24T08:50:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![DataBjorn](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@DataBjorn](https://discuss.elastic.co/u/DataBjorn)
#### Post date: [July 24, 2024, 8:50am UTC](https://discuss.elastic.co/t/filter-for-fields-that-are-present-in-data-views/363685/1 "2024-07-24T08:50:04Z")

</div>

When our users are going through the various data sources present in our Elastic stack, they often struggle to know which fields are present in order to build dashboards and alerts.

For example: For Metricbeat data, the Discover app will present all the possible fields that _can_ be present based on the loaded templates. This list is obviously much longer than the _actual_ present fields.

Is there a way to generate a list (either in Kibana or outside using APIs) that will show which fields are actually populated with data?

---

<div class="post-metadata">

### Author: ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)
#### Post date: [July 24, 2024, 9:13am UTC](https://discuss.elastic.co/t/filter-for-fields-that-are-present-in-data-views/363685/2 "2024-07-24T09:13:54Z")

</div>

Hello Bjorn,

I think the best way is to copy the used Index Template and then customize the copy to only affect your index, increase priority (so your custom template will be used instead of the default one) and only add the fields you require (you may need to remove one of the component templates that contain the unnecessary mappings).

Best regards  
Wolfram

---

<div class="post-metadata">

### Author: ![jughosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jughosta/32/107160_2.png) [@jughosta](https://discuss.elastic.co/u/jughosta)
#### Post date: [July 25, 2024, 8:32am UTC](https://discuss.elastic.co/t/filter-for-fields-that-are-present-in-data-views/363685/3 "2024-07-25T08:32:11Z")

</div>

Hi @DataBjorn,

Welcome to the community!

Fields capabilities API [Field capabilities API | Elasticsearch Guide [8.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html) allows to filter out empty fields when `include_empty_fields=false` is specified. Example:

```auto
POST kibana*/_field_caps?include_empty_fields=false
{
  "fields": ["*"]
}

```

---

<div class="post-metadata">

### Author: ![jughosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jughosta/32/107160_2.png) [@jughosta](https://discuss.elastic.co/u/jughosta)
#### Post date: [July 25, 2024, 8:33am UTC](https://discuss.elastic.co/t/filter-for-fields-that-are-present-in-data-views/363685/4 "2024-07-25T08:33:31Z")

</div>

There is also `drop_null_columns` for ES|QL queries [ES|QL query API | Elasticsearch Guide [8.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-query-api.html)

---

<div class="post-metadata">

### Author: ![DataBjorn](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@DataBjorn](https://discuss.elastic.co/u/DataBjorn)
#### Post date: [July 29, 2024, 10:55am UTC](https://discuss.elastic.co/t/filter-for-fields-that-are-present-in-data-views/363685/5 "2024-07-29T10:55:38Z")

</div>

Thanks - I will certainly have a look at that!
