# How can i get the query time of each index on a nodes not all the cluster?

**URL:** <https://discuss.elastic.co/t/how-can-i-get-the-query-time-of-each-index-on-a-nodes-not-all-the-cluster/13876>\
**Category:** Elasticsearch\
**Created:** [October 8, 2013, 1:32pm UTC](https://discuss.elastic.co/t/how-can-i-get-the-query-time-of-each-index-on-a-nodes-not-all-the-cluster/13876 "2013-10-08T13:32:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![11131](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/11131/32/2061_2.png) [@11131](https://discuss.elastic.co/u/11131)\
**Post date:** [October 8, 2013, 1:32pm UTC](https://discuss.elastic.co/t/how-can-i-get-the-query-time-of-each-index-on-a-nodes-not-all-the-cluster/13876/1 "2013-10-08T13:32:47Z")

</div>

hello, all  
I have a ES cluster(5 nodes, 2 indices, 10 shards per index). Now i want to  
monitor the ES performance with Zabbix.

I can get total query time for each index with indices stats api[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-stats.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-stats.html).  
this time is the sum of query time in all shards on all nodes for this  
index.(Am i right?)

I also can get total query time for each nodes with nodes stats api[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html).  
this time is the sum of all shards(no matter which index it it belongs to)  
on this nodes .(Am i right?)

now, my question is how can i get the query time of each index on a nodes  
not all the cluster?  
is there a API can do this? or can I calculate this value from other API?

Thanks! any advice is Appreciate.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [October 9, 2013, 4:44pm UTC](https://discuss.elastic.co/t/how-can-i-get-the-query-time-of-each-index-on-a-nodes-not-all-the-cluster/13876/2 "2013-10-09T16:44:59Z")

</div>

I do not think this functionality is exposed, but it should be technically  
possible. From what I understand from the code, the search stats are saved  
per index and are then aggregated into the node stats.

Cheers,

Ivan

On Tue, Oct 8, 2013 at 6:32 AM, 尹川 [yinchuan.blue@gmail.com](mailto:yinchuan.blue@gmail.com) wrote:

> hello, all  
> I have a ES cluster(5 nodes, 2 indices, 10 shards per index). Now i want  
> to monitor the ES performance with Zabbix.
> 
> I can get total query time for each index with indices stats api[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-stats.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-stats.html).  
> this time is the sum of query time in all shards on all nodes for this  
> index.(Am i right?)
> 
> I also can get total query time for each nodes with nodes stats api[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html).  
> this time is the sum of all shards(no matter which index it it belongs to)  
> on this nodes .(Am i right?)
> 
> now, my question is how can i get the query time of each index on a nodes  
> not all the cluster?  
> is there a API can do this? or can I calculate this value from other API?
> 
> Thanks! any advice is Appreciate.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![11131](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/11131/32/2061_2.png) [@11131](https://discuss.elastic.co/u/11131)\
**Post date:** [October 10, 2013, 3:40am UTC](https://discuss.elastic.co/t/how-can-i-get-the-query-time-of-each-index-on-a-nodes-not-all-the-cluster/13876/3 "2013-10-10T03:40:06Z")

</div>

Thanks for reply. I think adding a API to do this is not hard, so I  
issuse a feature request on Github.

On Thu, Oct 10, 2013 at 12:44 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> I do not think this functionality is exposed, but it should be technically  
> possible. From what I understand from the code, the search stats are saved  
> per index and are then aggregated into the node stats.
> 
> Cheers,
> 
> Ivan
> 
> On Tue, Oct 8, 2013 at 6:32 AM, 尹川 [yinchuan.blue@gmail.com](mailto:yinchuan.blue@gmail.com) wrote:
> 
> > hello, all  
> > I have a ES cluster(5 nodes, 2 indices, 10 shards per index). Now i want  
> > to monitor the ES performance with Zabbix.
> > 
> > I can get total query time for each index with indices stats api. this  
> > time is the sum of query time in all shards on all nodes for this index.(Am  
> > i right?)
> > 
> > I also can get total query time for each nodes with nodes stats api. this  
> > time is the sum of all shards(no matter which index it it belongs to) on  
> > this nodes .(Am i right?)
> > 
> > now, my question is how can i get the query time of each index on a nodes  
> > not all the cluster?  
> > is there a API can do this? or can I calculate this value from other API?
> > 
> > Thanks! any advice is Appreciate.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/XbZflyo\_5iU/unsubscribe](https://groups.google.com/d/topic/elasticsearch/XbZflyo_5iU/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
一片树林里分出两条路——  
而我选择了人迹更少的一条，  
从此决定了我一生的道路。  
Site: [www.chuan-small.me](http://www.chuan-small.me)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![11131](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/11131/32/2061_2.png) [@11131](https://discuss.elastic.co/u/11131)\
**Post date:** [October 10, 2013, 9:27am UTC](https://discuss.elastic.co/t/how-can-i-get-the-query-time-of-each-index-on-a-nodes-not-all-the-cluster/13876/4 "2013-10-10T09:27:11Z")

</div>

from @imotov

It's already there. You just need to add level=shards to your request. Try this:

$ curl "localhost:9200/\_stats?pretty&level=shards"

On Thu, Oct 10, 2013 at 11:40 AM, 尹川 [yinchuan.blue@gmail.com](mailto:yinchuan.blue@gmail.com) wrote:

> Thanks for reply. I think adding a API to do this is not hard, so I  
> issuse a feature request on Github.
> 
> On Thu, Oct 10, 2013 at 12:44 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> 
> > I do not think this functionality is exposed, but it should be technically  
> > possible. From what I understand from the code, the search stats are saved  
> > per index and are then aggregated into the node stats.
> > 
> > Cheers,
> > 
> > Ivan
> > 
> > On Tue, Oct 8, 2013 at 6:32 AM, 尹川 [yinchuan.blue@gmail.com](mailto:yinchuan.blue@gmail.com) wrote:
> > 
> > > hello, all  
> > > I have a ES cluster(5 nodes, 2 indices, 10 shards per index). Now i want  
> > > to monitor the ES performance with Zabbix.
> > > 
> > > I can get total query time for each index with indices stats api. this  
> > > time is the sum of query time in all shards on all nodes for this index.(Am  
> > > i right?)
> > > 
> > > I also can get total query time for each nodes with nodes stats api. this  
> > > time is the sum of all shards(no matter which index it it belongs to) on  
> > > this nodes .(Am i right?)
> > > 
> > > now, my question is how can i get the query time of each index on a nodes  
> > > not all the cluster?  
> > > is there a API can do this? or can I calculate this value from other API?
> > > 
> > > Thanks! any advice is Appreciate.
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> > > 
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/XbZflyo\_5iU/unsubscribe](https://groups.google.com/d/topic/elasticsearch/XbZflyo_5iU/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 一片树林里分出两条路——  
> 而我选择了人迹更少的一条，  
> 从此决定了我一生的道路。  
> Site: [www.chuan-small.me](http://www.chuan-small.me)

--  
一片树林里分出两条路——  
而我选择了人迹更少的一条，  
从此决定了我一生的道路。  
Site: [www.chuan-small.me](http://www.chuan-small.me)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:13am UTC](https://discuss.elastic.co/t/how-can-i-get-the-query-time-of-each-index-on-a-nodes-not-all-the-cluster/13876/5 "2017-07-06T02:13:05Z")

</div>


