# Combining two fields from tow different documents within the same index based on conditions

**URL:** https://discuss.elastic.co/t/combining-two-fields-from-tow-different-documents-within-the-same-index-based-on-conditions/342708
**Category:** Elasticsearch
**Created:** [September 11, 2023, 6:12am UTC](https://discuss.elastic.co/t/combining-two-fields-from-tow-different-documents-within-the-same-index-based-on-conditions/342708 "2023-09-11T06:12:55Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![DivyaDileep](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@DivyaDileep](https://discuss.elastic.co/u/DivyaDileep)
#### Post date: [September 11, 2023, 6:12am UTC](https://discuss.elastic.co/t/combining-two-fields-from-tow-different-documents-within-the-same-index-based-on-conditions/342708/1 "2023-09-11T06:12:56Z")

</div>

I am having data as below in one of the index  
@timestamp instance\_name dskIndex dskPercent dskPath  
Sep 8, 2023 @ 21:45:27.332 ssc-b 3 - /disk0.7  
Sep 8, 2023 @ 21:45:27.332 ssc-b 3 22 -

I want the instance\_name & dskIndex in both messages to be matched, then the dskPath & dskPercent fields displayed so it shows what the partition is called & how full it is in a percentage.

how to achieve this using elasticsearch(dynamically when new values comes) ?

---

<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: [October 9, 2023, 6:12am UTC](https://discuss.elastic.co/t/combining-two-fields-from-tow-different-documents-within-the-same-index-based-on-conditions/342708/2 "2023-10-09T06:12:59Z")

</div>

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