# Elasticsearch query for two logs into one log

**URL:** https://discuss.elastic.co/t/elasticsearch-query-for-two-logs-into-one-log/124477
**Category:** Elasticsearch
**Created:** [March 19, 2018, 3:15am UTC](https://discuss.elastic.co/t/elasticsearch-query-for-two-logs-into-one-log/124477 "2018-03-19T03:15:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![shwesinhan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shwesinhan/32/78663_2.png) [@shwesinhan](https://discuss.elastic.co/u/shwesinhan)
#### Post date: [March 19, 2018, 3:15am UTC](https://discuss.elastic.co/t/elasticsearch-query-for-two-logs-into-one-log/124477/1 "2018-03-19T03:15:37Z")

</div>

hi there!

could i have any idea for below situation.

i have these two logs

`2018-03-19 09:51:04,500 (null) 19 WARN : mypage: TEST :: mnost2bj2pnqdzjajkvio20u :: Frontend Response : <FResponse><version>9.1</version><timeStamp>190318095104</timeStamp><RefID>1001</RefID></FResponse>`

`2018-03-19 09:51:04,500 (null) 19 WARN : mypage: TEST :: knost3bj2pnqdzbajkvio30u :: Backend Response : <BResponse><version>9.1</version><timeStamp>190318095104</timeStamp><RefID>1001</RefID></BResponse>`

These two logs have same `RefID` which is already done with grok pattern. I want to assume that if i found these two logs with same `RefID`, i just want to count 1 time in kibana.

Is there any elasticsearch query to do like that?

I would appreciate for any advice.

---

<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 16, 2018, 3:16am UTC](https://discuss.elastic.co/t/elasticsearch-query-for-two-logs-into-one-log/124477/2 "2018-04-16T03:16:31Z")

</div>

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