# Query Metrics and Index to ElasticSearch

**URL:** <https://discuss.elastic.co/t/query-metrics-and-index-to-elasticsearch/64532>\
**Category:** Elasticsearch\
**Created:** [November 1, 2016, 9:02am UTC](https://discuss.elastic.co/t/query-metrics-and-index-to-elasticsearch/64532 "2016-11-01T09:02:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mvenkat\_in](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@mvenkat\_in](https://discuss.elastic.co/u/mvenkat_in)\
**Post date:** [November 1, 2016, 9:02am UTC](https://discuss.elastic.co/t/query-metrics-and-index-to-elasticsearch/64532/1 "2016-11-01T09:02:15Z")

</div>

I am using File Beat & LogStash to Collect the logs from various source and indexing the raw logs/CDRs to ES 5.0 and the key purpose of monitoring is the transaction KPIs such as TPS, Latency min wise or so... The aggregation/summary of the KPIs is done by Kibana over detailed logs.  
I would need to generate the aggregated KPI historical statistics for reporting purpose in Kibana..

Is there anyway I can run the Queries in ES to collect the aggregated KPIs and store/redirect the output into a KPI Index.

Appreciate if any one can give sample example.

Many Thanks  
Venkatesh

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [November 1, 2016, 9:10am UTC](https://discuss.elastic.co/t/query-metrics-and-index-to-elasticsearch/64532/2 "2016-11-01T09:10:40Z")

</div>

You mean you want to periodically calculate some statistics and then store them back into another index? I don't think there's a dedicated API for that, people usually use a client to query one index, potentially manipulate the results in some ways and store that somewhere else (e.g. another index).

---

<div class="post-metadata">

**Author:** ![mvenkat\_in](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@mvenkat\_in](https://discuss.elastic.co/u/mvenkat_in)\
**Post date:** [November 1, 2016, 9:12am UTC](https://discuss.elastic.co/t/query-metrics-and-index-to-elasticsearch/64532/3 "2016-11-01T09:12:59Z")

</div>

Hi  
Yes. Say i want to query from the "logs index" at the mid night for metrics like transaction count per min ..etc and store into another index.

Is there any sample client program/script to guide me on how to do this.

---

<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 5, 2017, 10:07pm UTC](https://discuss.elastic.co/t/query-metrics-and-index-to-elasticsearch/64532/4 "2017-07-05T22:07:55Z")

</div>


