Hi All
I have a csv file, which gives me response in multiline csv, i need convert that in a single line csv,
Here is the data
"header1","header2","header3"
"col1row1","col2row1","col3row1"
"col1row2","col2row2","col3row2"
if i use this below configuration, i get the response like this
{"message":"\"col1row2\",\"col2row2\",\"col3row2\"\r"}
{"message":"\"col1row1\",\"col2row1\",\"col3row1\"\r"}
my expected result it to get all the value of key "message" combined into a single value.
You can say its a case of combining all multiline csv value to a single line
{"message": "col1row1","col2row1","col3row1"
"col1row2","col2row2","col3row2"}
OR
{"message": "col1row1","col2row1","col3row1"\n
"col1row2","col2row2","col3row2"}
This is my conf file
input{
file {
path => "/csv_data.csv"
sincedb_path => "/sincedb.txt"
type => "csv"
start_position => "beginning"
}
}
filter {
mutate {
remove_field => ["host","@version","@timestamp","type","path"]
}
}
output {
file {
path => "/test.csv"
}
}
Please let me know how we can combine all the value. I also tried checking aggregation filter, but no example usecase found to be a valid for this
Thanks