# Java stack traces in example at elastic dosn't work Multiline java type log

**URL:** <https://discuss.elastic.co/t/java-stack-traces-in-example-at-elastic-dosnt-work-multiline-java-type-log/65598>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 10, 2016, 7:47am UTC](https://discuss.elastic.co/t/java-stack-traces-in-example-at-elastic-dosnt-work-multiline-java-type-log/65598 "2016-11-10T07:47:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex88](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@alex88](https://discuss.elastic.co/u/alex88)\
**Post date:** [November 10, 2016, 7:47am UTC](https://discuss.elastic.co/t/java-stack-traces-in-example-at-elastic-dosnt-work-multiline-java-type-log/65598/1 "2016-11-10T07:47:44Z")

</div>

I have log:

```auto
2016-11-10 06:52:09.868+0000 ERROR The RuntimeException could not be mapped to a response
 java.lang.ArrayIndexOutOfBoundsException: 1
              at org.neo4j.server.rest.repr.formats.UrlFormFormat.readMap(UrlFormFormat.java:99)
              at org.neo4j.server.rest.dbms.UserService.setPassword(UserService.java:94)    
              at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethod
    DispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205) 

```

second string start with java... following 3 lines with whitespace and at and then random line I wan to get it to logstash as a single event.  
My filebeat config

```auto
multiline:
      pattern: '^[[:space:]]+|^java'
      negate: false
      match: after

```

with this i can achieve 2 event but i need one message last string doesn't involve

---

<div class="post-metadata">

**Author:** ![alex88](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@alex88](https://discuss.elastic.co/u/alex88)\
**Post date:** [November 10, 2016, 10:21am UTC](https://discuss.elastic.co/t/java-stack-traces-in-example-at-elastic-dosnt-work-multiline-java-type-log/65598/2 "2016-11-10T10:21:00Z")

</div>

can anyone help me please?

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [November 10, 2016, 12:29pm UTC](https://discuss.elastic.co/t/java-stack-traces-in-example-at-elastic-dosnt-work-multiline-java-type-log/65598/3 "2016-11-10T12:29:05Z")

</div>

Assuming you are using filebeat 5.0, pleae have a look here: [https://www.elastic.co/guide/en/beats/filebeat/5.0/multiline-examples.html#\_testing\_your\_regexp\_pattern\_for\_multiline](https://www.elastic.co/guide/en/beats/filebeat/5.0/multiline-examples.html#_testing_your_regexp_pattern_for_multiline) You can use this to test your own regexp against your pattern.

Please be patient when you open a question. If you need commercial support have a look at: [https://www.elastic.co/subscriptions](https://www.elastic.co/subscriptions)

---

<div class="post-metadata">

**Author:** ![alex88](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@alex88](https://discuss.elastic.co/u/alex88)\
**Post date:** [November 10, 2016, 12:34pm UTC](https://discuss.elastic.co/t/java-stack-traces-in-example-at-elastic-dosnt-work-multiline-java-type-log/65598/4 "2016-11-10T12:34:28Z")

</div>

thanks ruflin  
but I use filebeat 1.3.1 and I've already read this article but can't sort out how to solve it completely

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [November 10, 2016, 1:16pm UTC](https://discuss.elastic.co/t/java-stack-traces-in-example-at-elastic-dosnt-work-multiline-java-type-log/65598/5 "2016-11-10T13:16:16Z")

</div>

normal log lines start with year and trace never start with a digit? =\> Use a pattern checking for a digit `pattern: '^[[:digit:]]'`

---

<div class="post-metadata">

**Author:** ![alex88](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@alex88](https://discuss.elastic.co/u/alex88)\
**Post date:** [November 10, 2016, 1:17pm UTC](https://discuss.elastic.co/t/java-stack-traces-in-example-at-elastic-dosnt-work-multiline-java-type-log/65598/6 "2016-11-10T13:17:54Z")

</div>

thanks steffens good idea i wiil try

---

<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:** [December 8, 2016, 1:18pm UTC](https://discuss.elastic.co/t/java-stack-traces-in-example-at-elastic-dosnt-work-multiline-java-type-log/65598/7 "2016-12-08T13:18:20Z")

</div>

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