# Creating our own kibana metric based upon the api response

**URL:** https://discuss.elastic.co/t/creating-our-own-kibana-metric-based-upon-the-api-response/294075
**Category:** Kibana
**Created:** [January 11, 2022, 7:00pm UTC](https://discuss.elastic.co/t/creating-our-own-kibana-metric-based-upon-the-api-response/294075 "2022-01-11T19:00:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![adnan-krit](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@adnan-krit](https://discuss.elastic.co/u/adnan-krit)
#### Post date: [January 11, 2022, 7:00pm UTC](https://discuss.elastic.co/t/creating-our-own-kibana-metric-based-upon-the-api-response/294075/1 "2022-01-11T19:00:54Z")

</div>

Hi Discussion Team,  
Is there any way we can create our own metric based on an Elasticsearch API response ? So my use case is, that i want to keep track on rejected requests on my Elasticsearch cluster  
(i.e, response from this API --\> curl -X GET "localhost:9200/\_cat/thread\_pool/search?v=true&h=id,name,active,rejected,completed&pretty")  
make the above API request as a metric (basically this API should be executed every 10 sec or based on some specified time unit) and visualise this metric on a graph.

Does kibana have the above given functionality to achieve my use case ? or If not, can it be achieved by any other way ?

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [January 12, 2022, 8:52am UTC](https://discuss.elastic.co/t/creating-our-own-kibana-metric-based-upon-the-api-response/294075/2 "2022-01-12T08:52:26Z")

</div>

I'm not aware of any built-in functionality to achieve this. You could create a little script somewhere in your favorite language which executes this query, then ingests a document based on the response and call it via cron job every 10 seconds.

In Kibana you can then build a visualization based on these documents with the regular tools.

However it sounds like you want to monitor your ES cluster which is a built-in functionality - just check out [Elasticsearch Monitoring Metrics | Kibana Guide [7.16] | Elastic](https://www.elastic.co/guide/en/kibana/current/elasticsearch-metrics.html)

---

<div class="post-metadata">

### Author: ![adnan-krit](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@adnan-krit](https://discuss.elastic.co/u/adnan-krit)
#### Post date: [January 12, 2022, 5:32pm UTC](https://discuss.elastic.co/t/creating-our-own-kibana-metric-based-upon-the-api-response/294075/3 "2022-01-12T17:32:34Z")

</div>

Thank you @flash1293

---

<div class="post-metadata">

### Author: ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)
#### Post date: [January 21, 2022, 10:49pm UTC](https://discuss.elastic.co/t/creating-our-own-kibana-metric-based-upon-the-api-response/294075/4 "2022-01-21T22:49:53Z")

</div>

If you want to implement it using elk, logstash http input could be an option, though it is not a built-in coordinating function for elk but general function for any http request.

> **[Http input plugin | Logstash Reference \[7.16\] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http.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: [February 18, 2022, 10:49pm UTC](https://discuss.elastic.co/t/creating-our-own-kibana-metric-based-upon-the-api-response/294075/5 "2022-02-18T22:49:58Z")

</div>

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