# How to get the field names which have no data or null in elasticsearch dynamically?

**URL:** <https://discuss.elastic.co/t/how-to-get-the-field-names-which-have-no-data-or-null-in-elasticsearch-dynamically/291591>\
**Category:** Elasticsearch\
**Created:** [December 13, 2021, 6:17am UTC](https://discuss.elastic.co/t/how-to-get-the-field-names-which-have-no-data-or-null-in-elasticsearch-dynamically/291591 "2021-12-13T06:17:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saurabh\_A](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saurabh_a/32/98781_2.png) [@Saurabh\_A](https://discuss.elastic.co/u/Saurabh_A)\
**Post date:** [December 13, 2021, 6:17am UTC](https://discuss.elastic.co/t/how-to-get-the-field-names-which-have-no-data-or-null-in-elasticsearch-dynamically/291591/1 "2021-12-13T06:17:53Z")

</div>

How do we get the field names with no data in them? For example, in an index, there is a field that is present in the mapping but no data is indexed in this case. So I want a list of all the field names or keys where there is no data present. Kindly help me out with this query. I don't want to use all the field names in the exists query. This should work for any index.

---

<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:** [January 10, 2022, 6:17am UTC](https://discuss.elastic.co/t/how-to-get-the-field-names-which-have-no-data-or-null-in-elasticsearch-dynamically/291591/2 "2022-01-10T06:17:59Z")

</div>

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