Creating our own kibana metric based upon the api response

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 ?

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

Thank you @flash1293

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.