Why Kibana does his own weird formatting of my error.stack_trace?

Hello

I'm using Discover in Kibana 8.2.2

When I display a my raw error.stack_trace in Kibana Discover, I can see this extract :

\n\tat java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:580)\n\tat org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:355)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) (...)

What I expect from Kibana is to replace "\n" by new lines and "\t" by tabs, like I would do in a text editor (replace "\\n" by "\n" special character and replace "\\t" by "\t" special character)

 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:355)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) (...)

but this is what I can see when I add the error.stack_trace field to my Discover view :

image
It feels like Kibana has replaced spaces by <br/> and \n and \t by &nbsp;

Is this a feature or a bug ? Can I customize it ?

Hi @Tristan107 and welcome to the community!

It was a bug. An upgrade to one of the latest versions (after 8.5) should resolve it.

Ok thanks for confirming the bug, the workaround is to open the event using the "Toggle dialog with details" button on the left of the line, then clic on "Single document".

There the error.stack_trace is properly formatted.