Text Formatting

Hi,

This is probably not a Kibana issue (great start!)....or atleast the answer doesn't lie in Kibana....i dont know.

When I search for my data sitting in elasticsearch using the Console in Kibana - there is a text field that I have which contains ... well lots of text.

In Kibana when I run my GET - that text field returns nicely formatted with all the Carriage Returns/Line feeds and looks fine.

When I try and return that same data via a site (javascript, etc...) - the whole formatting goes and it is just one clump of text.
(see probably not a kibana question...).

I am just struggling to understand why I cannot return that field exactly as it shows in ES.

If there is some advice - I would appreciate it.

Many Thanks,

If you're calling the Elasticsearch API to search for documents and a field contains newlines/carriage returns and you show it in a HTML page, you will need to convert the newlines into <br> tags or show the result within <pre> tag.

Thank you Luca - that is what I needed. I am sure that sounded like a basic question now....

Thanks so much.

1 Like

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