# How to check stats of all saved objects

**URL:** <https://discuss.elastic.co/t/how-to-check-stats-of-all-saved-objects/245553>\
**Category:** Kibana\
**Created:** [August 19, 2020, 8:55am UTC](https://discuss.elastic.co/t/how-to-check-stats-of-all-saved-objects/245553 "2020-08-19T08:55:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Redcxx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redcxx/32/73872_2.png) [@Redcxx](https://discuss.elastic.co/u/Redcxx)\
**Post date:** [August 19, 2020, 8:55am UTC](https://discuss.elastic.co/t/how-to-check-stats-of-all-saved-objects/245553/1 "2020-08-19T08:55:43Z")

</div>

Hi I am using the `saved_objects` API to create visualizations and dashboard, but since Kibana does not validate the data as mentioned [here](https://www.elastic.co/guide/en/kibana/current/saved-objects-api-create.html):

> When you create saved objects, attributes are not validated, which allows you to pass arbitrary and ill-formed data into the API that can break Kibana. Make sure any data that you send to the API is properly formed.

So I want to check some attributes before passing the data to Kibana, such as whether the index-pattern, field names exists and does the type of the field make sense to create visualization. May I know how can I do it?

Thanks!

---

<div class="post-metadata">

**Author:** ![myasonik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/myasonik/32/62369_2.png) [@myasonik](https://discuss.elastic.co/u/myasonik)\
**Post date:** [August 20, 2020, 10:17pm UTC](https://discuss.elastic.co/t/how-to-check-stats-of-all-saved-objects/245553/2 "2020-08-20T22:17:41Z")

</div>

You'd do this in the app/plugin/whatever you're writing.

Depending on the type of saved object you're creating, there may not be a lot to check against in elasticsearch. If you want to check if a certain saved object exists already (such as an index pattern), you can use the [find](https://www.elastic.co/guide/en/kibana/current/saved-objects-api-find.html) or [get](https://www.elastic.co/guide/en/kibana/current/saved-objects-api-get.html) saved object apis.

---

<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:** [September 17, 2020, 10:17pm UTC](https://discuss.elastic.co/t/how-to-check-stats-of-all-saved-objects/245553/3 "2020-09-17T22:17:45Z")

</div>

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