# Dedup on hostname

**URL:** <https://discuss.elastic.co/t/dedup-on-hostname/189381>\
**Category:** Kibana\
**Created:** [July 8, 2019, 4:13pm UTC](https://discuss.elastic.co/t/dedup-on-hostname/189381 "2019-07-08T16:13:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hursto75](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hursto75/32/8168_2.png) [@hursto75](https://discuss.elastic.co/u/hursto75)\
**Post date:** [July 8, 2019, 4:13pm UTC](https://discuss.elastic.co/t/dedup-on-hostname/189381/1 "2019-07-08T16:13:45Z")

</div>

I have a search that should be fairly simple, and cannot figure out how to do it.  
I want to show the latest result for a string one per hostname. Want to do this in KQL if possible.

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [July 8, 2019, 4:24pm UTC](https://discuss.elastic.co/t/dedup-on-hostname/189381/2 "2019-07-08T16:24:25Z")

</div>

I don't think you'll be able to on Discover - because we're grouping on hostname we'll need to use aggregations.

Using the data table visualization you'll want to the Y axis metric using top hits, sorted on timestamp, On the x axis, a terms aggregation on hostname. The search string can be included in the search bar. Is that closer to what you're looking for?

---

<div class="post-metadata">

**Author:** ![hursto75](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hursto75/32/8168_2.png) [@hursto75](https://discuss.elastic.co/u/hursto75)\
**Post date:** [July 9, 2019, 12:40pm UTC](https://discuss.elastic.co/t/dedup-on-hostname/189381/3 "2019-07-09T12:40:03Z")

</div>

That will work. Thank you for your help. Got the results i was looking for.

Brad

---

<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:** [August 6, 2019, 12:40pm UTC](https://discuss.elastic.co/t/dedup-on-hostname/189381/4 "2019-08-06T12:40:09Z")

</div>

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