# How do I get unique keys counts, not unique values per key?

**URL:** <https://discuss.elastic.co/t/how-do-i-get-unique-keys-counts-not-unique-values-per-key/338044>\
**Category:** Kibana\
**Created:** [July 10, 2023, 8:20pm UTC](https://discuss.elastic.co/t/how-do-i-get-unique-keys-counts-not-unique-values-per-key/338044 "2023-07-10T20:20:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecc256](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ecc256/32/59815_2.png) [@ecc256](https://discuss.elastic.co/u/ecc256)\
**Post date:** [July 10, 2023, 8:20pm UTC](https://discuss.elastic.co/t/how-do-i-get-unique-keys-counts-not-unique-values-per-key/338044/1 "2023-07-10T20:20:00Z")

</div>

I have a collections of documents.  
What query can produce unique keys counts (for a time interval), not unique values per key?  
It might be too simple to do and not mentioned anywhere... thus I cannot find it?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [July 12, 2023, 10:48pm UTC](https://discuss.elastic.co/t/how-do-i-get-unique-keys-counts-not-unique-values-per-key/338044/2 "2023-07-12T22:48:00Z")

</div>

There are Elasticsearch APIs that give you info about the fields themselves, such as the mapping API and field caps API. These APIs provide metadata to help applications like Kibana work, and aren't meant for analysis that can be done in Kibana.

You probably want to have a transform to retrieve information from your index, transform it into statistics, and store it in another index. See [Transforming data | Elasticsearch Guide [8.8] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/transforms.html)

---

<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:** [August 9, 2023, 10:48pm UTC](https://discuss.elastic.co/t/how-do-i-get-unique-keys-counts-not-unique-values-per-key/338044/3 "2023-08-09T22:48:52Z")

</div>

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