# How to get information from CVS file(working like jdbc\_streaming) in filter section for enrichment?

**URL:** https://discuss.elastic.co/t/how-to-get-information-from-cvs-file-working-like-jdbc-streaming-in-filter-section-for-enrichment/107892
**Category:** Logstash
**Created:** [November 16, 2017, 9:33am UTC](https://discuss.elastic.co/t/how-to-get-information-from-cvs-file-working-like-jdbc-streaming-in-filter-section-for-enrichment/107892 "2017-11-16T09:33:07Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![dsakpal](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@dsakpal](https://discuss.elastic.co/u/dsakpal)
#### Post date: [November 16, 2017, 9:33am UTC](https://discuss.elastic.co/t/how-to-get-information-from-cvs-file-working-like-jdbc-streaming-in-filter-section-for-enrichment/107892/1 "2017-11-16T09:33:07Z")

</div>

Scenario: Taking particular value from log file & depending on that value I need to get information from static CSV file.

So we are getting ASSETID from log file. Using that ASSETID I need to find ASSETNAME & ASSETGRP from csv file(mapping of ASSETID & ASSETNAME is already stoared into the csv file). So I just need a 'assetname' & 'assetgrp' from csv.

---

<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: [November 16, 2017, 9:35am UTC](https://discuss.elastic.co/t/how-to-get-information-from-cvs-file-working-like-jdbc-streaming-in-filter-section-for-enrichment/107892/2 "2017-11-16T09:35:10Z")

</div>

Use the translate filter.

---

<div class="post-metadata">

### Author: ![dsakpal](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@dsakpal](https://discuss.elastic.co/u/dsakpal)
#### Post date: [November 16, 2017, 9:46am UTC](https://discuss.elastic.co/t/how-to-get-information-from-cvs-file-working-like-jdbc-streaming-in-filter-section-for-enrichment/107892/3 "2017-11-16T09:46:57Z")

</div>

Thanks but I have few doubt in my mind about translate filter, they are as below

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/4/342f2cf57a1f86f15a3d3b4f3219c7e6063f2f76.png)

but if I want to get two fields/values from csv then how do I do that?  
My csv file format is like that,  
Column ===\> ASSETID, ASSETNAME, ASSETGRP

I am getting ASSETID from my log file & retrive ASSETNAME & ASSETGRP from csv in one attempt.

---

<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: [November 16, 2017, 9:54am UTC](https://discuss.elastic.co/t/how-to-get-information-from-cvs-file-working-like-jdbc-streaming-in-filter-section-for-enrichment/107892/4 "2017-11-16T09:54:24Z")

</div>

You can format the file as

```
ASSETID,ASSETNAME;ASSETGRP

```

and extract the asset name and group into a single field and then use another filter to further split it up.

---

<div class="post-metadata">

### Author: ![dsakpal](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@dsakpal](https://discuss.elastic.co/u/dsakpal)
#### Post date: [November 16, 2017, 10:01am UTC](https://discuss.elastic.co/t/how-to-get-information-from-cvs-file-working-like-jdbc-streaming-in-filter-section-for-enrichment/107892/5 "2017-11-16T10:01:49Z")

</div>

Thanks 🙂

---

<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: [December 14, 2017, 10:02am UTC](https://discuss.elastic.co/t/how-to-get-information-from-cvs-file-working-like-jdbc-streaming-in-filter-section-for-enrichment/107892/6 "2017-12-14T10:02:03Z")

</div>

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