# How to exhibit last record for each different possibility in a field?

**URL:** <https://discuss.elastic.co/t/how-to-exhibit-last-record-for-each-different-possibility-in-a-field/213987>\
**Category:** Kibana\
**Created:** [January 7, 2020, 6:24am UTC](https://discuss.elastic.co/t/how-to-exhibit-last-record-for-each-different-possibility-in-a-field/213987 "2020-01-07T06:24:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![b3owu1f](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/b3owu1f/32/60363_2.png) [@b3owu1f](https://discuss.elastic.co/u/b3owu1f)\
**Post date:** [January 7, 2020, 6:24am UTC](https://discuss.elastic.co/t/how-to-exhibit-last-record-for-each-different-possibility-in-a-field/213987/1 "2020-01-07T06:24:47Z")

</div>

Greetings,

I need help to find a way to exhibit the following type of data, filtering Locomotive id field to not repeat, showing only the last available record for each different Locomotive id in a given period of time.

 ![kibana1](https://us1.discourse-cdn.com/elastic/original/3X/5/4/54e36db4066633bfc4ea037584f9164a3a15ad4a.jpeg)

Thank you in advance for any help and directions.

Kibana Version: 5.6.15

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [January 8, 2020, 8:06pm UTC](https://discuss.elastic.co/t/how-to-exhibit-last-record-for-each-different-possibility-in-a-field/213987/2 "2020-01-08T20:06:07Z")

</div>

What about splitting the rows by the `Locomotive ID` terms, and having a metric column for the max of @timestamp?

In Kibana 7.5:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/c/6cae50df34b3ccfd19de3c20da9aaf447537229b.png)

---

<div class="post-metadata">

**Author:** ![b3owu1f](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/b3owu1f/32/60363_2.png) [@b3owu1f](https://discuss.elastic.co/u/b3owu1f)\
**Post date:** [January 9, 2020, 1:41am UTC](https://discuss.elastic.co/t/how-to-exhibit-last-record-for-each-different-possibility-in-a-field/213987/3 "2020-01-09T01:41:16Z")

</div>

That worked really well, it sorted perfectly. Thank you!  
I still need some fields from the search to show up in the visualization. I don't need any extra rules on them, they just need to show up along in the current results. Is that possible?

Thank you in advance for all the help.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [January 10, 2020, 4:42pm UTC](https://discuss.elastic.co/t/how-to-exhibit-last-record-for-each-different-possibility-in-a-field/213987/4 "2020-01-10T16:42:23Z")

</div>

Hi, you can show field additional field values in 2 ways:

1. Using the "Top Hits" metric aggregation: click the `Add` button in the `Metrics` panel and you can choose fields for a column of values of that field

2. You can sub-aggregate the terms aggregations of `name` by clicking the `Add` button in the `Buckets` panel

---

<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:** [February 7, 2020, 4:56pm UTC](https://discuss.elastic.co/t/how-to-exhibit-last-record-for-each-different-possibility-in-a-field/213987/5 "2020-02-07T16:56:31Z")

</div>

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