# Issue in aggregations in Elasticsearch and kibana

**URL:** <https://discuss.elastic.co/t/issue-in-aggregations-in-elasticsearch-and-kibana/161271>\
**Category:** Elasticsearch\
**Created:** [December 18, 2018, 8:02am UTC](https://discuss.elastic.co/t/issue-in-aggregations-in-elasticsearch-and-kibana/161271 "2018-12-18T08:02:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yashraj](https://avatars.discourse-cdn.com/v4/letter/y/aeb1de/32.png) [@yashraj](https://discuss.elastic.co/u/yashraj)\
**Post date:** [December 18, 2018, 8:02am UTC](https://discuss.elastic.co/t/issue-in-aggregations-in-elasticsearch-and-kibana/161271/1 "2018-12-18T08:02:38Z")

</div>

Hi,

I am using ELK version 6.1.1 with in my Ubuntu 16.04 LTS.

problem statement:

I have logs which are getting logged in every hour. First I want to find max of a particular field coming in that log line, now I want to get that log line whose field's value is max and extract value of another field from that logline and show on matrix visualization.

I am able to get the max of that field but i don't know how can we get that logline and extract another field from that.

It is just like a db query - `SELECT field2 FROM loggs WHERE field1 = 'max(field1)' AND duration = 'selected_duration'`;

Can anyone help me out to get the solution?

Thanks

---

<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:** [January 15, 2019, 8:02am UTC](https://discuss.elastic.co/t/issue-in-aggregations-in-elasticsearch-and-kibana/161271/2 "2019-01-15T08:02:39Z")

</div>

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