# Multiline stack trace not working

**URL:** https://discuss.elastic.co/t/multiline-stack-trace-not-working/378316
**Category:** Beats
**Tags:** filebeat
**Created:** [May 19, 2025, 10:00pm UTC](https://discuss.elastic.co/t/multiline-stack-trace-not-working/378316 "2025-05-19T22:00:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MelasticSan](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@MelasticSan](https://discuss.elastic.co/u/MelasticSan)
#### Post date: [May 19, 2025, 10:00pm UTC](https://discuss.elastic.co/t/multiline-stack-trace-not-working/378316/1 "2025-05-19T22:00:05Z")

</div>

```auto
filebeat.inputs:
- type: filestream
  enabled: true
  paths:
    - /var/tmp/javatest/simplejava.log
  json.keys_under_root: true
  json.add_error_key: false
  json.ignore_decoding_error: true
  json.overwrite_keys: true
multiline:
   pattern: '[0-9]{4}-[0-9]{2}-[0-9]{2}'
   negate: true
   match: after
output.file:
   path: "/var/tmp/javatest"
   filename: "JavaTesting.log"

```

Input file for test

```auto
Exception in thread "main" java.lang.IllegalStateException
       at com.example.myproject.Author.getBookIds(Author.java:38)
       at com.example.myproject.Bootstrap.main(Bootstrap.java:14)
       at com.example.myproject.Bootstrap.getBookTitle(Bootstrap.java:24)

```

It runs and creates the file but does not include all the lines in stack trace together .My multiline syntax is probably not correct ?

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [May 19, 2025, 11:50pm UTC](https://discuss.elastic.co/t/multiline-stack-trace-not-working/378316/2 "2025-05-19T23:50:20Z")

</div>

No you're multi-line syntax is not correct.

That syntax is from the old deprecated log type input.

> **[Manage multiline messages | Elastic Documentation](https://www.elastic.co/docs/reference/beats/filebeat/multiline-examples)**
>
> The files harvested by Filebeat may contain messages that span multiple lines of text. For example, multiline messages are common in files that contain...

> [@Filebeat multi line pattern not working](https://discuss.elastic.co/t/filebeat-multi-line-pattern-not-working/378301/6):
>
> You are using the wrong syntax for filestream that is old log type syntax - type: filestream # Change to true to enable this input configuration. enabled: true # Paths that should be crawled and fetched. Glob based paths. paths: - /Users/sbrown/workspace/sample-data/discuss/filebeat-multiline/test-log-378301.log #- c:\programdata\elasticsearch\logs\* parsers: - multiline: type: pattern pattern: '^\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} (AM|PM)' ne…

---

<div class="post-metadata">

### Author: ![MelasticSan](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@MelasticSan](https://discuss.elastic.co/u/MelasticSan)
#### Post date: [May 21, 2025, 3:54pm UTC](https://discuss.elastic.co/t/multiline-stack-trace-not-working/378316/3 "2025-05-21T15:54:54Z")

</div>

Thanks that worked .
