Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to strip/sanitize newlines when downloading CSV from searches #168187

Open
dcolazin opened this issue Oct 6, 2023 · 1 comment
Open
Labels
(Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)

Comments

@dcolazin
Copy link
Contributor

dcolazin commented Oct 6, 2023

Describe the feature: Currently (actually tested on 7.17.6, but behavior is identical on 8.6.2) there is no configuration to possibly strip newline characters from the fields of the generated csv.

The generated csv file is parsed wrongly by the most common spreadsheet editors when used naively: for example, such file is parsed correctly when "loaded" on Excel 2019 (Data -> From Text/CSV), but not when opened (exactly the opposite behavior described on Excel 2007!); I was not able to parse it properly with Libreoffice 7.2 csv text import.

It should be possible to strip newline characters (maybe replacing them with a single space?) to generate csv files that are readily available to be used by less spreadsheet-savvy users and single-line csv editors.

Describe a specific use case for the feature: When downloading a csv from a search, if a field contains newlines it appears as following (assuming the csv delimiter is the pipe | and the quoteValues is on)

"@timestamp"|"field_1"|"field_abc"|"field_potential_newlines_1"|"field_potential_newlines_2"
"Sep 20, 2023 @ 16:02:07.278"|1|"abc"|"{
	""json_field_2"": ""2"",
	""json_field_efg"": ""efg""
}"|"MESSAGE=[{
	""json_field_3"": ""3""
}]"

while it is possible to extract a valid csv from here (ignore newlines between single quotes, "" does not count), it is wrongly parsed by some editors. Related issue #20408

@botelastic botelastic bot added the needs-team Issues missing a team label label Oct 6, 2023
@jsanz jsanz added (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) labels Oct 13, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)
Projects
None yet
Development

No branches or pull requests

3 participants