# Stack-trace issue

**URL:** <https://discuss.elastic.co/t/stack-trace-issue/238016>\
**Category:** Logstash\
**Created:** [June 22, 2020, 7:01am UTC](https://discuss.elastic.co/t/stack-trace-issue/238016 "2020-06-22T07:01:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vshivare](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@vshivare](https://discuss.elastic.co/u/vshivare)\
**Post date:** [June 22, 2020, 7:01am UTC](https://discuss.elastic.co/t/stack-trace-issue/238016/1 "2020-06-22T07:01:15Z")

</div>

`This is my json message:`  
{ "module":"MODULE",  
"timeStamp":"Jun 22 12:20:46.785",  
"containerId":INDLT1534",  
"correlationId":"",  
"level":"ERROR",  
"logger":"c.m.r.HelloWorldService",  
"message":"This is due to java.lang.ClassNotFoundException: com.org.sequent.tag  
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0\_161]  
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0\_161]  
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[?:1.8.0\_161]  
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0\_161]  
at java.lang.Class.forName0(Native Method) ~[?:1.8.0\_161]  
at java.lang.Class.forName(Class.java:264) ~[?:1.8.0\_161]  
at com.mkyong.rest.HelloWorldService.main(HelloWorldService.java:19) [classes/:?]  
",  
"exception":" java.lang.ClassNotFoundException: com.org.sequent.tag  
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)  
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)  
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)  
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)  
at java.lang.Class.forName0(Native Method)  
at java.lang.Class.forName(Class.java:264)  
at com.mkyong.rest.HelloWorldService.main(HelloWorldService.java:19)  
"}

```
`Here is my logstash.conf file:`
input {
  tcp {
    port => 5120
    type => syslog
  }
  udp {
    port => 5120
    type => syslog
  }
}
filter {
  grok {
   match => { "message" => " {%{QS}:%{QS:module},%{QS}:%{QS:@timestamp},%{QS}:%{QS},%{QS:}:%{QS:correlationId},%{QS}:%{QS},%{QS}:%{QS},%{QS}:%{GREEDYDATA:message},%{QS}:%{QS}}" }
    overwrite => ["message"]
    named_captures_only => true
  }
}
output {
  elasticsearch { hosts => ["localhost:9200"] }
  stdout { codec => line }
}

```

For normal logs this config is working fine but once get any error this is not working. It is creating separate entry for each line. I have tried to replace /n with " " but then logs are not readable.  
Or if I replace /n with "[NEWLINE]", Is there any way on kibana to replace [NEWLINE] with actual newline only for display.

---

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [June 22, 2020, 7:43am UTC](https://discuss.elastic.co/t/stack-trace-issue/238016/2 "2020-06-22T07:43:28Z")

</div>

Hi Vishal,

Could you format the question to make it more readable?

---

<div class="post-metadata">

**Author:** ![vshivare](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@vshivare](https://discuss.elastic.co/u/vshivare)\
**Post date:** [June 22, 2020, 8:19am UTC](https://discuss.elastic.co/t/stack-trace-issue/238016/3 "2020-06-22T08:19:00Z")

</div>

Please check now.

---

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [June 23, 2020, 1:21am UTC](https://discuss.elastic.co/t/stack-trace-issue/238016/4 "2020-06-23T01:21:27Z")

</div>

Thank you!

There is no way to replace a newline just for display in Kibana. The only way the parser can work is if you account for the newline using something like gsub, which I believe you have already tried.

[https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-gsub](https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-gsub)

---

<div class="post-metadata">

**Author:** ![vshivare](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@vshivare](https://discuss.elastic.co/u/vshivare)\
**Post date:** [June 23, 2020, 6:13am UTC](https://discuss.elastic.co/t/stack-trace-issue/238016/5 "2020-06-23T06:13:41Z")

</div>

So can we do any change in lostash.conf so that it will allow multline logs as one message?

---

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [June 23, 2020, 6:24am UTC](https://discuss.elastic.co/t/stack-trace-issue/238016/6 "2020-06-23T06:24:37Z")

</div>

Yes, you will have to replace the newline "`/n`" with a space using gsub mentioned earlier.

---

<div class="post-metadata">

**Author:** ![vshivare](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@vshivare](https://discuss.elastic.co/u/vshivare)\
**Post date:** [June 23, 2020, 6:34am UTC](https://discuss.elastic.co/t/stack-trace-issue/238016/7 "2020-06-23T06:34:24Z")

</div>

but that message is not in readable format.

---

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [June 23, 2020, 6:51am UTC](https://discuss.elastic.co/t/stack-trace-issue/238016/8 "2020-06-23T06:51:32Z")

</div>

What do you mean by readable format? Could you show the message?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 21, 2020, 6:51am UTC](https://discuss.elastic.co/t/stack-trace-issue/238016/9 "2020-07-21T06:51:33Z")

</div>

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