# Logstash to parse custom exception log

**URL:** <https://discuss.elastic.co/t/logstash-to-parse-custom-exception-log/207685>\
**Category:** Logstash\
**Created:** [November 13, 2019, 10:59am UTC](https://discuss.elastic.co/t/logstash-to-parse-custom-exception-log/207685 "2019-11-13T10:59:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bamboomy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bamboomy/32/57597_2.png) [@bamboomy](https://discuss.elastic.co/u/bamboomy)\
**Post date:** [November 13, 2019, 10:59am UTC](https://discuss.elastic.co/t/logstash-to-parse-custom-exception-log/207685/1 "2019-11-13T10:59:23Z")

</div>

Dears,

I know there are a lot of tutorials and examples with almost an answer but I don't seem to get it right...

I want to parse exception logs

and they are in the following format:

## ERROR (some data that I like to parse) (some other data)

(the stacktrace)  
at ...  
Caused by: ...  
at ...  
ERROR (some data that I like to parse)  
(next event)

I seem to manage to get all the data in an event except for the ERROR line with:

input {  
file {

```
    path => "/exception_log4j.log.1"

    codec => multiline {
            pattern => "ERROR"
            negate => "true"
            what => "next"
    }

    sincedb_path => "/dev/null"

    start_position => "beginning"
  }

```

}

filter {

```
            grok {
                      match => {"message" => "%{GREEDYDATA:data}"}
            }

```

}

output{

```
    stdout { codec => rubydebug }

```

}

If I set negate to "false" any line is matched...

How do I get this data in one event and also the data of the ERROR line?

Or which other approach should I take?

Thanks for reading an it would be grand if you can help me a hand...

Best regards,

S.

---

<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 11, 2019, 10:59am UTC](https://discuss.elastic.co/t/logstash-to-parse-custom-exception-log/207685/2 "2019-12-11T10:59:23Z")

</div>

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