logstash-filter-csv
logstash-filter-csv copied to clipboard
Column Names keyword bug
When columns names are the same as keywords unexpected things happen, e.g. when tags is used as a column name the value is added within the logstash tags array.
This is due to column name values being called using event.get so there is no difference is syntax. Needs to be rectified somehow.
Can you give examples?
When "tags" is given as a column name event.get("tags") returns ["hello"] instead of "hello" as it expects tags such "_grokparsefailure" etc. which would be appended to the above array when they occur which is not expected by users.
`let(:doc) { "big,bird,sesame street,hello" } let(:config) do { "columns" => ["first", "last", "address", "tags" ] } end
it "extract all the values" do plugin.filter(event) expect(event.get("first")).to eq("big") expect(event.get("last")).to eq("bird") expect(event.get("address")).to eq("sesame street") expect(event.get("tags")).to eq("hello") end`
I think that is expected. logstash makes assumptions about the types of certain fields. [tags] has to be an array, [@timestamp] has to be a LogStash::Timestamp, or else things break. There may be others. It is not documented, it just is.