Open tak7iji opened 5 years ago
In a related note, in case anyone comes across this:
Spent quite a bit of time today scratching my head with a translate filter / dictionary_path issue. Resolution was to ensure that my keys had a colon with a space immediately after it, before the value was entered. Contents of YAML File - Dictionary_Path “1.1.1.1”: Net1 “2.1.1.1”: Net2
Version: Logstash 6.5.1(logstash-filter-translate-3.2.3)
Operating System: Linux
Config File (if you have sensitive info, please remove it): config file like this:
dictionary file:
Steps to Reproduce: An exception is raised if there is a CRLF in the dictionary file. After downgrading logstash-filter-translate from 3.2.3 to 3.1.0 or replacing CRLF to LF, everything works as expected.
Logs: [2019-02-12T16:37:31,073][ERROR][logstash.pipeline ] Error registering plugin {:pipeline_id=>"main", :plugin=>"#", :error=>"Translate: Unquoted fields do not allow \r or \n (line 1). when loading dictionary file at /etc/logstash/dic.csv", :thread=>"#"}
Details: https://github.com/logstash-plugins/logstash-filter-translate/blob/master/lib/logstash/filters/dictionary/csv_file.rb#L20 @csv.shift returns this error if line has \r\n as eol.
Workarounds: