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

Kibana feature : Allow users to display a string with newlines inside the datatable #76242

Closed
Tracked by #57709
AditiKhalatkar opened this issue Aug 29, 2020 · 20 comments · Fixed by #134441
Closed
Tracked by #57709
Assignees
Labels
enhancement New value added to drive a business result Feature:Data Table Data table visualization feature Feature:Discover Discover Application Feature:Lens Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@AditiKhalatkar
Copy link

Describe the feature:
If the value of a field is stored as a string having newlines in Elasticsearch, the feature may enable the user to display the string which parses "\n" as a newline in the string. This feature would be specifically useful for someone who wants newlines in a datatable, however other visualizations may also benefit from this. Kindly consider.

Describe a specific use case for the feature:
For instance, there is a field like address, having value = "X Street \n Y Apt \n Z State", the user may want to represent this value inside the datatable as:

"X Street
Y Apt
Z State"

@AditiKhalatkar AditiKhalatkar changed the title Kibana feature : To display a string with newlines inside the datatable Kibana feature : Allow users to display a string with newlines inside the datatable Aug 29, 2020
@markov00 markov00 added enhancement New value added to drive a business result Feature:Data Table Data table visualization feature Team:Visualizations Visualization editors, elastic-charts and infrastructure triage_needed labels Aug 31, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@piehld
Copy link

piehld commented Oct 2, 2020

I'd also like this feature, as we are currently performing the multiline consolidation process at the rsyslog stage, so incoming messages will contain the '\n' new line character.

EDIT: Please disregard my comment below--I realized the issue was due to the escaping of the new line character in the JSON message field.
In viewing the JSON formatted value of the message field (e.g., in Discover, clicking on a document -> JSON), the field I wanted to display as multi-line (in my case, 'message') contained \\n instead of just \n. So, I added a 'gsub' processor to my ingest pipeline to perform the conversion and it displays properly now!

For those who might benefit from this experience, this is what my message field looked like with problematic escaped new line characters (viewing it in JSON view):
"[2020-10-02 08:56:11 -0700] [25076] [INFO] [descriptorMatch.matchGetQuery] Got <DescriptorType.inchi: 'InChI'> 'RHFUOMFWUGWKKO-XVFCMESISA-N' 'graph-relaxed'\\nWarning: OEParseInChI failed on 'RHFUOMFWUGWKKO-XVFCMESISA-N'"

Confusingly however, the representation of the new line character in the original log message during ingestion was \\\\n, so I converted it to \n using the following the gsub processor:
{ "gsub": { "field": "message", "pattern": "\\\\n", "replacement": "\n" } }

OLD COMMENT - DISREGARD
I was surprised to find out that ingesting these lines into Elasticsearch (via Filebeat) did not render them as new lines in Kibana, as the use of the 'multiline' option in Filebeat (for a separate application) DOES render the new line characters into new lines in discover. So, I'm curious to know what additional action the 'multiline' option in Filebeat is doing to enable those new line characters to be rendered in Kibana, versus the case of ingesting a string containing new line characters.

@piehld
Copy link

piehld commented Oct 2, 2020

@AditiKhalatkar I'm not sure if my experience is the same as yours, but might be worth checking if you haven't already.

@srothkin
Copy link

srothkin commented Jan 8, 2021

We need this feature too.

@ruudkenter
Copy link

We need this feature as well

@ghudgins ghudgins mentioned this issue Sep 30, 2021
29 tasks
@flash1293
Copy link
Contributor

@stratoula Will this be possible once dynamic row height lands?

@stratoula
Copy link
Contributor

I am not 100% sure, I want to test it first. We definitely need to add the dynamic heights to support this. I am not sure if it will be supported without any change from our side. I will check it and update the issue :)

@stratoula
Copy link
Contributor

@flash1293 with the new auto-height we can have this result
image

but with double \n. For example the above screenshot is generated for this text: X Street \n\n Y Apt \n\n Z State

With a single \nI get them in the same line:
image

@ghudgins ghudgins added Feature:Discover Discover Application Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Mar 15, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@ghudgins
Copy link
Contributor

whatever we come up with for this in vis editors we should also do for Discover as well. Legacy table has this feature CC @VijayDoshi

@VijayDoshi
Copy link

Do we have a path forward on this? Seems like we are all in agreement that we should respect line breaks.

@flash1293
Copy link
Contributor

@kertal @stratoula It seems to me like we can simply add this behavior if the user has set an "auto" or multi line row height by replacing newlines by breaks for both Discover and Lens, what do you think?

@stratoula
Copy link
Contributor

Yes I was thinking the same ++

@kertal
Copy link
Member

kertal commented Mar 17, 2022

Sure thing

@flash1293
Copy link
Contributor

Do this automatically if row auto height is enabled (not supported for headers, only data rows)

@flavono123
Copy link

Where is the config in Kibana or Helm values?
Cannot find in Stack Management > Advanced Settings.

@stratoula
Copy link
Contributor

@flavono123 they are on Lens editor,

image

@flavono123
Copy link

flavono123 commented Jan 18, 2023

@stratoula So speedy !
May I configure on the "Discover", not Lens?
image

Kibana version is 7.13.1 and cannot find similar one from there.
I just upgraded the version to 7.17.3, stil cannot find, however.

@flavono123
Copy link

Oh, newlines work in Discover, never mind.

image

I did not selected, clicking the + button of the field("log").

Thank you for your very very fast response btw! @stratoula

@stratoula
Copy link
Contributor

Nice! It also exists in Discover btw but I am not pretty sure in which version it was added.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Data Table Data table visualization feature Feature:Discover Discover Application Feature:Lens Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.