CSV filter parsing errors

Hi

I am getting the below errors while parsing using CSV filter

[2018-02-21T08:30:48,657][WARN ][logstash.filters.csv ] Error parsing csv {:field=>"filename", :source=>["CNT415653", "CNT415653"], :exception=>#<NoMethodError: private method gets' called for ["CNT415653", "CNT415653"]:Array>} [2018-02-21T08:30:48,709][WARN ][logstash.filters.csv ] Error parsing csv {:field=>"filename", :source=>["CNT2704692", "CNT2704692"], :exception=>#<NoMethodError: private methodgets' called for ["CNT2704692", "CNT2704692"]:Array>}
[2018-02-21T08:30:48,712][WARN ][logstash.filters.csv ] Error parsing csv {:field=>"filename", :source=>["CNT2721639", "CNT2721639"], :exception=>#<NoMethodError: private method gets' called for ["CNT2721639", "CNT2721639"]:Array>} [2018-02-21T08:30:48,766][WARN ][logstash.filters.csv ] Error parsing csv {:field=>"filename", :source=>"CNT2495746", :exception=>java.lang.ClassCastException} [2018-02-21T08:30:48,783][WARN ][logstash.filters.csv ] Error parsing csv {:field=>"filename", :source=>"CNT2101827", :exception=>java.lang.ClassCastException} [2018-02-21T08:30:48,786][WARN ][logstash.filters.csv ] Error parsing csv {:field=>"filename", :source=>["CNT1865927", "CNT1865927"], :exception=>#<NoMethodError: private methodgets' called for ["CNT1865927", "CNT1865927"]:Array>}

CSV filter

if [filename]{
csv { source => "filename"
separator => ","
columns => ["[docname1]","[docname2]"]
#target => "docname1"
}
}

Your filename field is an Array and not a String, as noted by the errors. Can you post a sample input line?

yes. It is an array. I have changed the filtering as below and it worked. Thanks.

csv {
source => "[filename][0]"
separator => ","
columns => ["[docname]","[docname1]"]
#skip_empty_rows => true
skip_empty_columns => true
}

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