# Search question: match docs based on a field's value in another search

**URL:** <https://discuss.elastic.co/t/search-question-match-docs-based-on-a-fields-value-in-another-search/166235>\
**Category:** Elasticsearch\
**Created:** [January 29, 2019, 9:15pm UTC](https://discuss.elastic.co/t/search-question-match-docs-based-on-a-fields-value-in-another-search/166235 "2019-01-29T21:15:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rozling](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rozling/32/16401_2.png) [@rozling](https://discuss.elastic.co/u/rozling)\
**Post date:** [January 29, 2019, 9:15pm UTC](https://discuss.elastic.co/t/search-question-match-docs-based-on-a-fields-value-in-another-search/166235/1 "2019-01-29T21:15:19Z")

</div>

Hi, I'm on Elasticsearch 6.4.3 and trying to delete a large swathe of logs generated by a loadbalancer's healthcheck, based on the healthcheck endpoint url.

For each request two documents were generated, one for the request and one for the response.

The problem is, only the 'request' has a field with the endpoint url. The 'response' doesn't contain that endpoint but does contain a correlation ID which both have in common.

So the question is, is it possible to create a search which matches the url, and also returns a set of documents where the corresponding correlation IDs match?

I had a look at the documentation for JOINs but I'm not sure if they solve the same problem, and anyway it seems that the JOIN needs to be defined at the time of indexing? [https://www.elastic.co/guide/en/elasticsearch/reference/6.4/parent-join.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/parent-join.html)

---

<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:** [February 26, 2019, 9:15pm UTC](https://discuss.elastic.co/t/search-question-match-docs-based-on-a-fields-value-in-another-search/166235/2 "2019-02-26T21:15:25Z")

</div>

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