# Translate Filter plugin for a real CSV

**URL:** https://discuss.elastic.co/t/translate-filter-plugin-for-a-real-csv/263940
**Category:** Logstash
**Created:** [February 10, 2021, 11:23pm UTC](https://discuss.elastic.co/t/translate-filter-plugin-for-a-real-csv/263940 "2021-02-10T23:23:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jchaves506](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@jchaves506](https://discuss.elastic.co/u/jchaves506)
#### Post date: [February 10, 2021, 11:23pm UTC](https://discuss.elastic.co/t/translate-filter-plugin-for-a-real-csv/263940/1 "2021-02-10T23:23:36Z")

</div>

Hello  
I have a big CSV file(10 columns, 40Mb) that I want to use as a dictionary using the translate filter. I'm already doing that with a little csv files (2 columns, 4kb) and that is working fine. I'm doing it like this :

```auto
translate {
        field => "<numeric-value from beats, ie:101>"
        destination => "<name of the field I'll put the translation>"
        fallback => "not_found"
        dictionary => { #actually dictionaryPath
            "<numeric-value>" => "translation1" 
            "102" => "value2" 
            "190" => "value3" 
            }
        }

```

But I wanted to create a bigger dictionary with the other file, my idea is to assign [field] with a value I can look for in the CVS and get the dictionary looking what I want to translate based on the different columns from the CSV, not only a one-to-one translation...  
is this possible somehow?

a similar thread I found is this... [Translate filter plugin](https://discuss.elastic.co/t/translate-filter-plugin/167971) but that didn't gets to a solution.

thanks

---

<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: [February 10, 2021, 11:44pm UTC](https://discuss.elastic.co/t/translate-filter-plugin-for-a-real-csv/263940/2 "2021-02-10T23:44:05Z")

</div>

You will need to have the second column of the CSV be a data format that another filter can process. For example:

1. A csv with a different separator
2. JSON
3. key/value pairs

If the csv is static you can reformat it using logstash.

---

<div class="post-metadata">

### Author: ![jchaves506](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@jchaves506](https://discuss.elastic.co/u/jchaves506)
#### Post date: [February 11, 2021, 2:23pm UTC](https://discuss.elastic.co/t/translate-filter-plugin-for-a-real-csv/263940/3 "2021-02-11T14:23:35Z")

</div>

Thank you @Badger  
hmmm, so like having the rest of the columns I want to read in one only column, and then process that, like:  
dictionary =\> { #actually dictionaryPath  
"" =\> "translation1"  
"102" =\> "value2,value3,value4"  
}  
interesting... so, there is not way I can do this without reformatting the csv?

---

<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: [February 11, 2021, 8:02pm UTC](https://discuss.elastic.co/t/translate-filter-plugin-for-a-real-csv/263940/4 "2021-02-11T20:02:10Z")

</div>

> [@jchaves506](#):
>
> so, there is not way I can do this without reformatting the csv?

Not that I know of.

---

<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: [March 11, 2021, 8:02pm UTC](https://discuss.elastic.co/t/translate-filter-plugin-for-a-real-csv/263940/5 "2021-03-11T20:02:22Z")

</div>

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