Hi,
I am trying to format a csv file so that it can be used in the translate filter.
the csv file has only two columns (comma separated) with windows line ending format (CRLF)
which somehow causes the translate filter to throw an error --> "Unquoted fields do not allow \r or \n"
So, i attempted to use gsub to format the file to have Unix (LF) like the below.
filter {
mutate {
gsub => [ "message", "\r\n", "\n" ]
}
}
However, Although translate does not throw an error anymore, i dont think this is working since when i cat or nano the file...i see the contents in one long line like --> value1,value2\nvalue3,value4\nvalue5,value6....
instead of
value1
value2
value3
value4
value5
value6
Also, filters like cidr seem to throw an error saying it could not find valid network called "\n" which furthers the above assumption that it is somehow it is not able to "detect" an actual newline in the file.
I also tried various combinations like
gsub => [ "message", "\r\n", "\n" ]
gsub => [ "message", "\\r\\\n", "\n" ]
etc. but none of them worked
Any assistance would be appreciated
Thanks in advance!