Kibana CSV report only contains one line


When we are trying to generate a csv report in Kibana, the end result only contains the headers and the first line.

If I check the .reporting index the result is there just fine with all the desired lines.

However I've realized that the issue is related to new line characters (\n). The problem is that one of the column's values contain a newline character at the end of every string, and this somehow is taken as a literal new line when generating the csv.


"message":"some sample text\n"

This will end up looking like this in the .reporting index (output.content field of the JSON object):

"some sample text

Instead of:

"some sample text"

Is there a way to solve this issue without manipulating the JSON object in the .reporting index?


To answer my own question:

I had to modify the csv generator code.



return value.toString();


return value.toString().replace(/\n$/, "");

Restart Kibana and it works.

(kulkarni) #3

Thanks for looping back and posting your solution here.


(system) #4

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