Hello Everyone, Logstash not reading csv file, i have tried all possible case but unable to pick data from the csv file. my ultimate goal is read data from REST API and mapping with CSV file. Please suggest, Configuration as below -
Hi, I'm fetching hostname from one of the event and search in csv file, on the match it should populate value field on display.
yes i have a plugin, but here in configuration am using translate.
Data present in csv file as below -
Hostname,Value
server_1,Windows
server_2,Linux
server_3,Unix
server_4,Windows
server_5,Linux
server_6,Unix
Getting below error while executing this configuration - [ERROR] 2022-06-07 10:52:12.251 [[main]-pipeline-manager] javapipeline - Pipeline error {:pipeline_id=>"main", :exception=>#<LogStash::Filters::Dictionary::DictionaryFileError: Translate: Missing or stray quote in line 1 when loading dictionary file at /etc/logstash/conf.d/filename.csv>, :backtrace=>["/usr/share/logstash/vendor/jruby/lib/ruby/stdlib/csv.rb:1899:in block in shift'"`
Hi, I have tried all possible formats/quotes but error remain persists.
Please suggest if there is any desired format for save.
below which i have tried.
Hi Leandro, I have tried all possible ways but can't do a lookup of a field in a csv file.
can you please suggest the translate plugin logic, herewith am pasting the error logs with debug mode.
Hi Leandro, We have tested with yaml and json format and it works perfectly fine. the problem occurs only on csv format. so can we conclude that csv format is not supported by translate plugin/within logstash.
This is not entirely right, the csv format is supported, but for some reason your csv wasn't working, maybe there was something related on how it is created in your system or things like that.
But to know why it wasn't working you would need to open a bug report in the Logstash Github.
Particularly I prefer to use yml files in my dictionaries, so if you changed to yml and it worked, you should keep using yml.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.