# Can we join two index fields in one index

**URL:** <https://discuss.elastic.co/t/can-we-join-two-index-fields-in-one-index/98624>\
**Category:** Elasticsearch\
**Created:** [August 29, 2017, 4:24am UTC](https://discuss.elastic.co/t/can-we-join-two-index-fields-in-one-index/98624 "2017-08-29T04:24:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinay\_garg](https://avatars.discourse-cdn.com/v4/letter/v/8dc957/32.png) [@vinay\_garg](https://discuss.elastic.co/u/vinay_garg)\
**Post date:** [August 29, 2017, 4:24am UTC](https://discuss.elastic.co/t/can-we-join-two-index-fields-in-one-index/98624/1 "2017-08-29T04:24:44Z")

</div>

Hi All,

Environment:  
ELK 5.5

We are having two index of different logs (haproxy-index and fuselog-index).  
Both index having different grok pattern.  
but in haproxy grok pattern having three fields  
'col1-ID':1  
'col2-Name':'Testing'  
'col3-Service':'Test'

FuseLog grok pattern  
'col1-ID':1  
'col2-Date':'2017-08-17'  
'col3-IP':'0.0.0.0'

But grok pattern having same col1-ID field.  
Is it possible to join fields of two index in one index? as mention in below example  
'col1-ID':1  
'col2-Name':'Testing'  
'col3-IP':'0.0.0.0'

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 29, 2017, 8:01am UTC](https://discuss.elastic.co/t/can-we-join-two-index-fields-in-one-index/98624/2 "2017-08-29T08:01:25Z")

</div>

FYI we’ve renamed ELK to the Elastic Stack, otherwise Beats feels left out 😉

> [@vinay\_garg](#):
>
> Is it possible to join fields of two index in one index? as mention in below example

No it is not, it's not possible to joins in Elasticsearch at all.

---

<div class="post-metadata">

**Author:** ![vinay\_garg](https://avatars.discourse-cdn.com/v4/letter/v/8dc957/32.png) [@vinay\_garg](https://discuss.elastic.co/u/vinay_garg)\
**Post date:** [August 29, 2017, 8:03am UTC](https://discuss.elastic.co/t/can-we-join-two-index-fields-in-one-index/98624/3 "2017-08-29T08:03:05Z")

</div>

So can you give any other idea to solve it?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 29, 2017, 8:03am UTC](https://discuss.elastic.co/t/can-we-join-two-index-fields-in-one-index/98624/4 "2017-08-29T08:03:24Z")

</div>

What is the problem you are trying to solve?

---

<div class="post-metadata">

**Author:** ![vinay\_garg](https://avatars.discourse-cdn.com/v4/letter/v/8dc957/32.png) [@vinay\_garg](https://discuss.elastic.co/u/vinay_garg)\
**Post date:** [August 29, 2017, 9:14am UTC](https://discuss.elastic.co/t/can-we-join-two-index-fields-in-one-index/98624/5 "2017-08-29T09:14:53Z")

</div>

I have to monitor 200,500,502,504 response code from haproxy log. Based on i have to define fuse log pattern. So that i can easily rectify where the 200,500,502,504 response occur.  
I hope it is clear.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 29, 2017, 9:17am UTC](https://discuss.elastic.co/t/can-we-join-two-index-fields-in-one-index/98624/6 "2017-08-29T09:17:25Z")

</div>

That can be handled by grok.

---

<div class="post-metadata">

**Author:** ![vinay\_garg](https://avatars.discourse-cdn.com/v4/letter/v/8dc957/32.png) [@vinay\_garg](https://discuss.elastic.co/u/vinay_garg)\
**Post date:** [August 30, 2017, 2:05am UTC](https://discuss.elastic.co/t/can-we-join-two-index-fields-in-one-index/98624/7 "2017-08-30T02:05:40Z")

</div>

Thanks for share you input.

---

<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 27, 2017, 2:05am UTC](https://discuss.elastic.co/t/can-we-join-two-index-fields-in-one-index/98624/8 "2017-09-27T02:05:54Z")

</div>

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