# Search and show result based on comparing terms

**URL:** <https://discuss.elastic.co/t/search-and-show-result-based-on-comparing-terms/146005>\
**Category:** Kibana\
**Created:** [August 25, 2018, 9:12am UTC](https://discuss.elastic.co/t/search-and-show-result-based-on-comparing-terms/146005 "2018-08-25T09:12:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jibsonline](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jibsonline/32/63154_2.png) [@jibsonline](https://discuss.elastic.co/u/jibsonline)\
**Post date:** [August 25, 2018, 9:12am UTC](https://discuss.elastic.co/t/search-and-show-result-based-on-comparing-terms/146005/1 "2018-08-25T09:12:08Z")

</div>

I have two types of logs shown in kibana

1. Response

> ```
> {"origin":"local","type":"response","correlation":"beb2b44b1cef5623","duration":663,"protocol":"HTTP/1.1","status":200,"headers":{"Content-Type":["application/json;charset=UTF-8"],.......
> .........
> :"success"}}}
> 
> ```

1. Request

> ```
> {"origin":"remote","type":"request","correlation":"beb2b44b1cef5623","protocol":"HTTP/1.1","remote":"104.124.54.30","method":"GET"......
> .......
> .......
> }}
> 
> ```

NB. The value for '`correlation`' would be unique and same for each request and response  
I am able to find slow responses using the '`duration`' term from response. I want to map the correlation term and show the request instead of the response in search results.

How can I achieve the same?

---

<div class="post-metadata">

**Author:** ![jibsonline](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jibsonline/32/63154_2.png) [@jibsonline](https://discuss.elastic.co/u/jibsonline)\
**Post date:** [August 25, 2018, 5:04pm UTC](https://discuss.elastic.co/t/search-and-show-result-based-on-comparing-terms/146005/2 "2018-08-25T17:04:01Z")

</div>

Should I be using the join datatype?

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [August 27, 2018, 4:34pm UTC](https://discuss.elastic.co/t/search-and-show-result-based-on-comparing-terms/146005/3 "2018-08-27T16:34:50Z")

</div>

The join datatype won't help here because [Kibana doesn't support it yet](https://github.com/elastic/kibana/issues/20255). If you can manage it the best thing to do here would be to normalize your data so the request and response info are in a single document.

---

<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:** [September 24, 2018, 4:34pm UTC](https://discuss.elastic.co/t/search-and-show-result-based-on-comparing-terms/146005/4 "2018-09-24T16:34:59Z")

</div>

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