# Input from two csv files and compare

**URL:** <https://discuss.elastic.co/t/input-from-two-csv-files-and-compare/178238>\
**Category:** Logstash\
**Created:** [April 24, 2019, 11:53am UTC](https://discuss.elastic.co/t/input-from-two-csv-files-and-compare/178238 "2019-04-24T11:53:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nandha\_88](https://avatars.discourse-cdn.com/v4/letter/n/3e96dc/32.png) [@nandha\_88](https://discuss.elastic.co/u/nandha_88)\
**Post date:** [April 24, 2019, 11:53am UTC](https://discuss.elastic.co/t/input-from-two-csv-files-and-compare/178238/1 "2019-04-24T11:53:48Z")

</div>

Hi Team,

I am planning to get the input from two csf files, assign the columns value and if the device column value match , I need the print the ip address in the output .  
Please share the codes to compare and print

```
nput

```

{  
file{  
type =\> data  
path =\> ["/home/nandha/nandha.csv","/home/nandha/test.csv"]  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
}  
}  
filter  
{  
if [path] == "/home/nandha/nandha.csv"  
{  
csv {  
separator =\> ","  
columns =\> ["eventState","severity","device","count","ipAddress"]  
}  
}  
if [path] == "/home/nandha/test.csv"  
{  
csv {  
separator =\> ","  
columns =\> ["eventStateone","severityone","deviceone","countone"]  
}  
}  
}  
output  
{  
stdout {  
codec =\> rubydebug  
}  
}

---

<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 24, 2019, 2:12pm UTC](https://discuss.elastic.co/t/input-from-two-csv-files-and-compare/178238/2 "2019-04-24T14:12:59Z")

</div>

You could lookup the IP address of the device using a [translate](https://www.elastic.co/guide/en/logstash/current/plugins-filters-translate.html) filter. A translate filter requires a two column csv file as its input.

---

<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 22, 2019, 2:13pm UTC](https://discuss.elastic.co/t/input-from-two-csv-files-and-compare/178238/3 "2019-05-22T14:13:00Z")

</div>

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