# Translate v3.2.3 on LS 6.5.0: does not work anymore with .csv file

**URL:** https://discuss.elastic.co/t/translate-v3-2-3-on-ls-6-5-0-does-not-work-anymore-with-csv-file/159161
**Category:** Logstash
**Created:** [December 3, 2018, 12:02pm UTC](https://discuss.elastic.co/t/translate-v3-2-3-on-ls-6-5-0-does-not-work-anymore-with-csv-file/159161 "2018-12-03T12:02:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Michel99\_7](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@Michel99\_7](https://discuss.elastic.co/u/Michel99_7)
#### Post date: [December 3, 2018, 12:02pm UTC](https://discuss.elastic.co/t/translate-v3-2-3-on-ls-6-5-0-does-not-work-anymore-with-csv-file/159161/1 "2018-12-03T12:02:18Z")

</div>

Dear all,

I'm trying to migrate a pipeline from LS 6.3.2 to 6.5.0 but there's a problem during its execution due to an error on the translate filter (used with a .csv file): "Unquoted fields do not allow \r or \n".

[2018-12-03T11:44:11,680][INFO][logstash.outputs.elasticsearch] Installing elasticsearch template to \_template/cpdlc\_template  
[2018-12-03T11:44:11,697][ERROR][logstash.pipeline] Error registering plugin {:pipeline\_id=\>"cpdlc-main", :plugin=\>"#\<LogStash::FilterDelegator:0x141b418 @metric\_events\_out=org.jruby.proxy.org.logstash.instrument.metrics.counter.LongCounter$Proxy2 - name: out value:0, @metric\_events\_in=org.jruby.proxy.org.logstash.instrument.metrics.counter.LongCounter$Proxy2 - name: in value:0, @metric\_events\_time=org.jruby.proxy.org.logstash.instrument.metrics.counter.LongCounter$Proxy2 - name: duration\_in\_millis value:0, @id="04f903c8cbc83b41265f9af525ef563877fcf096f2efba2a0153755bc6b83e4d", @klass=LogStash::Filters::Translate, @metric\_events=#LogStash::Instrument::NamespacedMetric:0x1f371ec1, @filter=\<LogStash::Filters::Translate destination=\>"ADES\_Country", dictionary\_path=\>"/data\_bkp/logstash/00\_Common/translate/countries.csv", exact=\>true, regex=\>true, id=\>"04f903c8cbc83b41265f9af525ef563877fcf096f2efba2a0153755bc6b83e4d", field=\>"ADES", enable\_metric=\>true, periodic\_flush=\>false, override=\>false, refresh\_interval=\>300, refresh\_behaviour=\>"merge"\>\>", :error=\>"Translate: Unquoted fields do not allow \r or \n (line 1). when loading dictionary file at /data\_bkp/logstash/00\_Common/translate/countries.csv", :thread=\>"#\<Thread:0x40824a07@/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:157 run\>"}

- Environment: Linux
- LS 6.5.0 on Docker
- translate file: countries.csv: example of content

^AG[A-Z]+$,Solomon Islands

^AN[A-Z]+$,Nauru

Any clue about that?  
I didn't change anything on the .csv file.  
Thanks in advance.

Michel

---

<div class="post-metadata">

### Author: ![sampas](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@sampas](https://discuss.elastic.co/u/sampas)
#### Post date: [December 13, 2018, 5:38pm UTC](https://discuss.elastic.co/t/translate-v3-2-3-on-ls-6-5-0-does-not-work-anymore-with-csv-file/159161/2 "2018-12-13T17:38:44Z")

</div>

The same thing happened to us after upgrading from 6.4.2 to 6.5.3. The release notes for 6.5 allude to it: **Translate filter**

- Fix to align with docs - looked-up values are always strings. Coerce better.  
(more here [https://www.elastic.co/guide/en/logstash/current/logstash-6-5-0.html](https://www.elastic.co/guide/en/logstash/current/logstash-6-5-0.html))

I had to to 2 things to fix it:

1. enclose the items in double quotes  
change lookupvalue, translatevalue  
to  
"lookupvalue","translatevalue"
2. run dos2unix on the csv file. The file was generated on a windows machine. We run logstash on linux with csv lookup tables. Don't know about windows lookup tables yet.

I don't know how it works with regex.

Larry

---

<div class="post-metadata">

### Author: ![Michel99\_7](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@Michel99\_7](https://discuss.elastic.co/u/Michel99_7)
#### Post date: [December 14, 2018, 9:07am UTC](https://discuss.elastic.co/t/translate-v3-2-3-on-ls-6-5-0-does-not-work-anymore-with-csv-file/159161/3 "2018-12-14T09:07:42Z")

</div>

Many thanks, Larry for your message.

In fact, I succeeded in making it work: I just converted the .csv file build on Windows by editing it in Wordpad++ and selecting the option "Edit \> EOL conversion \> Unix (LF)" and saving it.

The problem was due to the end of line character which is not the same between Windows and Unix.

---

<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: [January 11, 2019, 9:07am UTC](https://discuss.elastic.co/t/translate-v3-2-3-on-ls-6-5-0-does-not-work-anymore-with-csv-file/159161/4 "2019-01-11T09:07:43Z")

</div>

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