# Join two csv files

**URL:** https://discuss.elastic.co/t/join-two-csv-files/301949
**Category:** Logstash
**Created:** [April 8, 2022, 10:10am UTC](https://discuss.elastic.co/t/join-two-csv-files/301949 "2022-04-08T10:10:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![S-elk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s-elk/32/98464_2.png) [@S-elk](https://discuss.elastic.co/u/S-elk)
#### Post date: [April 8, 2022, 10:10am UTC](https://discuss.elastic.co/t/join-two-csv-files/301949/1 "2022-04-08T10:10:52Z")

</div>

Hello!

I have 2 csv files that share a common field and I would like to pass 2 fields from one of the files to the other.

The functionality that I want is the same that I usually have with the Elasticsearch filter obtaining fields from an index via a common field but with csv before indexing.

Is this possible ?

```auto
input{
  csv1
}

input {
  csv2
}

filter{ 
  join
}

output{

}

```

Thanks in advanced!

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [April 8, 2022, 2:25pm UTC](https://discuss.elastic.co/t/join-two-csv-files/301949/2 "2022-04-08T14:25:55Z")

</div>

> [@S-elk](#):
>
> I have 2 csv files that share a common field and I would like to pass 2 fields from one of the files to the other.

Use a translate filter. There are many threads that discuss this. For example, [here](https://discuss.elastic.co/t/logstash-how-to-configure-csv-filter-for-joining-2-csv-files-based-on-a-common-field-and-send-the-joined-log-to-es/167125) and [here](https://discuss.elastic.co/t/merge-data-and-metadata-csv-file-in-logstash/295815).

---

<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: [May 6, 2022, 2:25pm UTC](https://discuss.elastic.co/t/join-two-csv-files/301949/3 "2022-05-06T14:25:59Z")

</div>

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