# Hello! I want to use multiline codec patterns in my use case.. Here I want to read the multiple lines as one event

**URL:** <https://discuss.elastic.co/t/hello-i-want-to-use-multiline-codec-patterns-in-my-use-case-here-i-want-to-read-the-multiple-lines-as-one-event/195473>\
**Category:** Logstash\
**Created:** [August 16, 2019, 10:26am UTC](https://discuss.elastic.co/t/hello-i-want-to-use-multiline-codec-patterns-in-my-use-case-here-i-want-to-read-the-multiple-lines-as-one-event/195473 "2019-08-16T10:26:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![satyam2593](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@satyam2593](https://discuss.elastic.co/u/satyam2593)\
**Post date:** [August 16, 2019, 10:26am UTC](https://discuss.elastic.co/t/hello-i-want-to-use-multiline-codec-patterns-in-my-use-case-here-i-want-to-read-the-multiple-lines-as-one-event/195473/1 "2019-08-16T10:26:17Z")

</div>

My input logs looks like:

* * *

## START the log printing 08/09/2019 10:12:45

## 43003|Thread1|20.3|33.4 34532|Thread2|73.5|75.5

## END the log printing 08/09/2019 10:13:05

Can anyone please provide the input filter with multiline codec

Note: In the above input logs the hypen is overirded with space

---

<div class="post-metadata">

**Author:** ![Ged](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ged/32/65761_2.png) [@Ged](https://discuss.elastic.co/u/Ged)\
**Post date:** [August 16, 2019, 11:26am UTC](https://discuss.elastic.co/t/hello-i-want-to-use-multiline-codec-patterns-in-my-use-case-here-i-want-to-read-the-multiple-lines-as-one-event/195473/2 "2019-08-16T11:26:47Z")

</div>

Try something like below in your input section.  
You only need to create regex to catch start of your block.  
In my case it's timestamp so i'm using pattern =\> "%{TIMESTAMP\_ISO8601}"

```
file {
	path => ["/path/to/your/file.log"]
	codec => multiline {
		pattern => "regex_matching_start_of_your_event"
		negate => true
		what => previous
	}
}

```

and then parse received message using grok if needed.

---

<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:** [September 13, 2019, 11:26am UTC](https://discuss.elastic.co/t/hello-i-want-to-use-multiline-codec-patterns-in-my-use-case-here-i-want-to-read-the-multiple-lines-as-one-event/195473/3 "2019-09-13T11:26:48Z")

</div>

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