# Get all the fields from an index with specific type

**URL:** <https://discuss.elastic.co/t/get-all-the-fields-from-an-index-with-specific-type/321852>\
**Category:** Elasticsearch\
**Created:** [December 22, 2022, 3:14pm UTC](https://discuss.elastic.co/t/get-all-the-fields-from-an-index-with-specific-type/321852 "2022-12-22T15:14:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikssssss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikssssss/32/115176_2.png) [@nikssssss](https://discuss.elastic.co/u/nikssssss)\
**Post date:** [December 22, 2022, 3:14pm UTC](https://discuss.elastic.co/t/get-all-the-fields-from-an-index-with-specific-type/321852/1 "2022-12-22T15:14:40Z")

</div>

hi all, how it is possible to get the all the fields from an index that are mapped as a date for example

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [December 23, 2022, 2:14am UTC](https://discuss.elastic.co/t/get-all-the-fields-from-an-index-with-specific-type/321852/2 "2022-12-23T02:14:15Z")

</div>

Hi @nikssssss

If your field has a prefix or endfix, you can use the command below to retrieve the fields: (you will retrieve fields that end with "date" like "creation\_date", "end\_date".

`GET my-index-000001/_mapping/field/*date`

Another option is to create a script (python) that received a json mapping and extract the field by type.

---

<div class="post-metadata">

**Author:** ![nikssssss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikssssss/32/115176_2.png) [@nikssssss](https://discuss.elastic.co/u/nikssssss)\
**Post date:** [December 23, 2022, 8:43am UTC](https://discuss.elastic.co/t/get-all-the-fields-from-an-index-with-specific-type/321852/3 "2022-12-23T08:43:48Z")

</div>

thanks , i know that, but i want to find the fields with type datetime. Sure i can do this with python..but i was thinking if i could use the rest interface (dev tools)

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [December 23, 2022, 12:23pm UTC](https://discuss.elastic.co/t/get-all-the-fields-from-an-index-with-specific-type/321852/4 "2022-12-23T12:23:13Z")

</div>

As far as I researched I couldn't find another way. Sorry.

---

<div class="post-metadata">

**Author:** ![nikssssss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikssssss/32/115176_2.png) [@nikssssss](https://discuss.elastic.co/u/nikssssss)\
**Post date:** [December 23, 2022, 12:45pm UTC](https://discuss.elastic.co/t/get-all-the-fields-from-an-index-with-specific-type/321852/5 "2022-12-23T12:45:45Z")

</div>

thank you @RabBit_BR for your time 😊

---

<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 20, 2023, 12:45pm UTC](https://discuss.elastic.co/t/get-all-the-fields-from-an-index-with-specific-type/321852/6 "2023-01-20T12:45:47Z")

</div>

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