# Analyzing logs by grouping set up logs in same thread

**URL:** <https://discuss.elastic.co/t/analyzing-logs-by-grouping-set-up-logs-in-same-thread/170873>\
**Category:** Elasticsearch\
**Created:** [March 5, 2019, 11:11am UTC](https://discuss.elastic.co/t/analyzing-logs-by-grouping-set-up-logs-in-same-thread/170873 "2019-03-05T11:11:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajesh2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajesh2/32/55074_2.png) [@Rajesh2](https://discuss.elastic.co/u/Rajesh2)\
**Post date:** [March 5, 2019, 11:11am UTC](https://discuss.elastic.co/t/analyzing-logs-by-grouping-set-up-logs-in-same-thread/170873/1 "2019-03-05T11:11:43Z")

</div>

Hi,  
I have following use case  
In one req-response cycle i will have 2 log statements like  
1. data is served from cache / or not  
2. total time taken for the request : 1234

I would like to analyze in kibana, how much % of requests are served from cache, avg time for req served from cache, avg time of req not served from cache.

How can i write query like -\> group all records having served from cache and get avg response time for those records.

---

<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:** [April 2, 2019, 11:11am UTC](https://discuss.elastic.co/t/analyzing-logs-by-grouping-set-up-logs-in-same-thread/170873/2 "2019-04-02T11:11:43Z")

</div>

Closed on April 2, 2019, 11:11am UTC

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