# Multi Document Search in the Same Index

**URL:** https://discuss.elastic.co/t/multi-document-search-in-the-same-index/246888
**Category:** Elasticsearch
**Created:** [August 30, 2020, 6:06pm UTC](https://discuss.elastic.co/t/multi-document-search-in-the-same-index/246888 "2020-08-30T18:06:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ShashikanthKomandoor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shashikanthkomandoor/32/46221_2.png) [@ShashikanthKomandoor](https://discuss.elastic.co/u/ShashikanthKomandoor)
#### Post date: [August 30, 2020, 6:06pm UTC](https://discuss.elastic.co/t/multi-document-search-in-the-same-index/246888/1 "2020-08-30T18:06:57Z")

</div>

Hi Team,

I am pushing the /var/log/maillog to ELK Stack version 6.X

I was able to use the postfix grok filters available in github and create the indices, documents, fields and so and also I am able to see in Kibana too.

I am capturing the header message id in the /var/log/maillog which is being pushed to ELK.

I want to know through ELK searches that the message ids which got successfully sent, deferred and softbounce.

Here I faced the challenge of writing the query of search for the above requirement as the header message id is recorded in /var/log/maillog in one line while the delivery status would be recorded in a different line.

As per my understanding, each record or each line in the log file is called as a document in an Index. Correct me if I am wrong.

So, is there a way that would solve my requirement ? This has become a great challenge from past few days for me.

---

<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 31, 2020, 2:03am UTC](https://discuss.elastic.co/t/multi-document-search-in-the-same-index/246888/2 "2020-08-31T02:03:47Z")

</div>

> [@ShashikanthKomandoor](#):
>
> As per my understanding, each record or each line in the log file is called as a document in an Index. Correct me if I am wrong.

Yes, that's correct 🙂

[Transforming data | Elasticsearch Guide [7.9] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/transforms.html) should be able to do what you want. Basically you want to create an entity-centric index, where the entity is the unique postfix ID.

---

<div class="post-metadata">

### Author: ![ShashikanthKomandoor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shashikanthkomandoor/32/46221_2.png) [@ShashikanthKomandoor](https://discuss.elastic.co/u/ShashikanthKomandoor)
#### Post date: [August 31, 2020, 8:48am UTC](https://discuss.elastic.co/t/multi-document-search-in-the-same-index/246888/3 "2020-08-31T08:48:33Z")

</div>

Thank you Warkolm for your immediate response. I am new to this concept of Transforming Data. Let me first study this and come back to you if any queries.

---

<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 28, 2020, 8:48am UTC](https://discuss.elastic.co/t/multi-document-search-in-the-same-index/246888/4 "2020-09-28T08:48:43Z")

</div>

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