# Workaround for 'JOIN' in Kibana/ES

**URL:** <https://discuss.elastic.co/t/workaround-for-join-in-kibana-es/105929>\
**Category:** Elasticsearch\
**Created:** [October 31, 2017, 4:45pm UTC](https://discuss.elastic.co/t/workaround-for-join-in-kibana-es/105929 "2017-10-31T16:45:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![seth.yes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seth.yes/32/11788_2.png) [@seth.yes](https://discuss.elastic.co/u/seth.yes)\
**Post date:** [October 31, 2017, 4:45pm UTC](https://discuss.elastic.co/t/workaround-for-join-in-kibana-es/105929/1 "2017-10-31T16:45:38Z")

</div>

I use Elasticsearch to document URLs requested by users.

I know that since this is a NoSQL database, there are issues with performing joins. I've read up on nested queries as well as parent/child aggregations, but am unsure if they'll solve my issue:

I need to find URLs accessed by a certain user, which were then later accessed by any other user.

I know in SQL I could do a join, e.g.

```auto
get 
  URL as infra_url,
   timestamp as infra_timestamp
     from url_index
     where username = 'infra' 
Join 
  URL as user_url,
   timestamp as user_timestamp
     from url_index
     where username != 'infra' 
     
     where infra_url = user_url and infra_timestamp < user_timestamp

```

Is there a similar way to perform this is Kibana/ES? I'm currently using the v5.6.2 stack.

---

<div class="post-metadata">

**Author:** ![shanec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shanec/32/4004_2.png) [@shanec](https://discuss.elastic.co/u/shanec)\
**Post date:** [November 2, 2017, 11:25pm UTC](https://discuss.elastic.co/t/workaround-for-join-in-kibana-es/105929/2 "2017-11-02T23:25:32Z")

</div>

You need to do one of a few things:

- Index the URL with infra/user nested/sub-objects/child docs
- Perform multiple queries

If you're using Kibana, you'll really need to completely denormalize on index and just shove it all into the same doc.

---

<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:** [November 30, 2017, 11:26pm UTC](https://discuss.elastic.co/t/workaround-for-join-in-kibana-es/105929/3 "2017-11-30T23:26:18Z")

</div>

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