# How to combine two file types in logstash

**URL:** <https://discuss.elastic.co/t/how-to-combine-two-file-types-in-logstash/41278>\
**Category:** Logstash\
**Created:** [February 9, 2016, 1:38pm UTC](https://discuss.elastic.co/t/how-to-combine-two-file-types-in-logstash/41278 "2016-02-09T13:38:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nivetha](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@nivetha](https://discuss.elastic.co/u/nivetha)\
**Post date:** [February 9, 2016, 1:38pm UTC](https://discuss.elastic.co/t/how-to-combine-two-file-types-in-logstash/41278/1 "2016-02-09T13:38:05Z")

</div>

I have two different file types as below  
file {  
path =\> "/opt/logsl/test\_log.log\*"  
#start\_position =\> "beginning"  
**type =\> "test1"**  
}  
file {  
path =\> "/opt/lookups/testcsv.csv"  
start\_position =\> "beginning"  
**type =\> "test2"**  
}

Both types have common field values. I need to match those fields and map the corresponding values.  
(similar to outer join)  
something like below snippet  
if test2.ServerIP\_1 == test1.ServerIP  
{  
add\_field =\> { "city\_ip" =\>test1. ServerName\_1}  
}

can anyone help me on this?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 9, 2016, 7:08pm UTC](https://discuss.elastic.co/t/how-to-combine-two-file-types-in-logstash/41278/2 "2016-02-09T19:08:30Z")

</div>

Logstash doesn't do joins with its stock plugins.

---

<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:** [July 6, 2017, 5:12am UTC](https://discuss.elastic.co/t/how-to-combine-two-file-types-in-logstash/41278/3 "2017-07-06T05:12:22Z")

</div>


