# Multiline Codec Pattern Match if String Exists

**URL:** <https://discuss.elastic.co/t/multiline-codec-pattern-match-if-string-exists/250225>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [September 28, 2020, 3:46pm UTC](https://discuss.elastic.co/t/multiline-codec-pattern-match-if-string-exists/250225 "2020-09-28T15:46:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NomadicCodeGuy](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@NomadicCodeGuy](https://discuss.elastic.co/u/NomadicCodeGuy)\
**Post date:** [September 28, 2020, 3:46pm UTC](https://discuss.elastic.co/t/multiline-codec-pattern-match-if-string-exists/250225/1 "2020-09-28T15:46:34Z")

</div>

Is it possible to configure the multiline codec to match a pattern if a message contains a certain string? If yes, what would this pattern look like? For example, if a message contains the string "Finished scenario" I would like to append it to the message that came before it.

---

<div class="post-metadata">

**Author:** ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)\
**Post date:** [September 29, 2020, 4:49pm UTC](https://discuss.elastic.co/t/multiline-codec-pattern-match-if-string-exists/250225/2 "2020-09-29T16:49:23Z")

</div>

Hi @NomadicCodeGuy 🙂

Take a look at this [https://www.elastic.co/guide/en/beats/filebeat/current/multiline-examples.html](https://www.elastic.co/guide/en/beats/filebeat/current/multiline-examples.html)

---

<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:** [October 27, 2020, 6:49pm UTC](https://discuss.elastic.co/t/multiline-codec-pattern-match-if-string-exists/250225/3 "2020-10-27T18:49:37Z")

</div>

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