# Merge 3 CSV files based on common column

**URL:** <https://discuss.elastic.co/t/merge-3-csv-files-based-on-common-column/148696>\
**Category:** Elasticsearch\
**Created:** [September 15, 2018, 10:07am UTC](https://discuss.elastic.co/t/merge-3-csv-files-based-on-common-column/148696 "2018-09-15T10:07:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravi\_yadav1](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@ravi\_yadav1](https://discuss.elastic.co/u/ravi_yadav1)\
**Post date:** [September 15, 2018, 10:07am UTC](https://discuss.elastic.co/t/merge-3-csv-files-based-on-common-column/148696/1 "2018-09-15T10:07:14Z")

</div>

Hi,  
I am trying to merge 3 csv files which have columns like:  
1st CSV: [oid, symbol, price, qty, side, err1]  
2nd CSV: [oid, tid, symbol, price, qty, side, err2, error\_msg]  
3rd CSV: [tid, symbol, price, qty, side, err3]

Now as you can see, i have to map oid of 1st csv with tid of 2nd csv and also tid of 3rd csv with oid of 2nd csv.

I think it is very similar to outer join queries in relational databases.

So what is approach should I follow for such kind of relationships between log files?

PS: I have already read many FAQs related to this and tried using Aggregation, Parent-child relationship, but no help ☹

---

<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:** [September 15, 2018, 10:33am UTC](https://discuss.elastic.co/t/merge-3-csv-files-based-on-common-column/148696/2 "2018-09-15T10:33:39Z")

</div>

You cannot do this in Elasticsearch, you need to do it during ingestion using something like Logstash.

---

<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 13, 2018, 10:33am UTC](https://discuss.elastic.co/t/merge-3-csv-files-based-on-common-column/148696/3 "2018-10-13T10:33:40Z")

</div>

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