# Multiple 'Multiline' blocks in same filebeat.yml - Filebeats

**URL:** <https://discuss.elastic.co/t/multiple-multiline-blocks-in-same-filebeat-yml-filebeats/215922>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [January 21, 2020, 4:56pm UTC](https://discuss.elastic.co/t/multiple-multiline-blocks-in-same-filebeat-yml-filebeats/215922 "2020-01-21T16:56:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![klang](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@klang](https://discuss.elastic.co/u/klang)\
**Post date:** [January 21, 2020, 4:56pm UTC](https://discuss.elastic.co/t/multiple-multiline-blocks-in-same-filebeat-yml-filebeats/215922/1 "2020-01-21T16:56:00Z")

</div>

I'm looking to understand if I may have more than 1 multiline.pattern defined in a filebeat configuration of which these multiline configurations would be against the same log file. When I run something similar to the below, none of the patterns work but if comment out all but one of them, the single multiline.pattern works.

```
 type: log
  tags: ["someAppTag"]
  paths:
    - /var/log/someapp/app.log

  # Merge multiple authentication lines into their own doc
  multiline:
    pattern: '^\*\*\* Received from '
    negate: true
    match: after

  # Merge App restart lines into their own doc
  multiline:
    pattern: 'app received sigterm'
    negate: true
    match: after
    flush_pattern: 'app is now running!'

```

The application log file I'm trying to document has several different unique messages to merge but I may only get one multiline.pattern working at a time. All of these entries are generic $timestamp.message lines spread across numerous lines and unreadable in Kibana without merging their multiline content into a single document. Any thoughts?

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [January 21, 2020, 5:37pm UTC](https://discuss.elastic.co/t/multiple-multiline-blocks-in-same-filebeat-yml-filebeats/215922/2 "2020-01-21T17:37:07Z")

</div>

Hi @klang and welcome to discuss 🙂

Defining multiple multiline blocks is not supported, and may lead to unexpected behaviours.

Something you can try is to merge both configurations into one, something like this:

```auto
  multiline:
    pattern: '(^\*\*\* Received from |app received sigterm)'
    negate: true
    match: after
    flush_pattern: 'app is now running!'

```

---

<div class="post-metadata">

**Author:** ![klang](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@klang](https://discuss.elastic.co/u/klang)\
**Post date:** [January 21, 2020, 5:49pm UTC](https://discuss.elastic.co/t/multiple-multiline-blocks-in-same-filebeat-yml-filebeats/215922/3 "2020-01-21T17:49:13Z")

</div>

Dang, I was hoping this was a thing. Thank you for the advice, what you shared would actually work for me. I will re-think my strategy and do some testing.

---

<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:** [February 25, 2020, 1:41am UTC](https://discuss.elastic.co/t/multiple-multiline-blocks-in-same-filebeat-yml-filebeats/215922/5 "2020-02-25T01:41:46Z")

</div>

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