# Exclude lines not working with multiline

**URL:** <https://discuss.elastic.co/t/exclude-lines-not-working-with-multiline/228411>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 16, 2020, 9:46pm UTC](https://discuss.elastic.co/t/exclude-lines-not-working-with-multiline/228411 "2020-04-16T21:46:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![EliWallic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eliwallic/32/66544_2.png) [@EliWallic](https://discuss.elastic.co/u/EliWallic)\
**Post date:** [April 16, 2020, 9:46pm UTC](https://discuss.elastic.co/t/exclude-lines-not-working-with-multiline/228411/1 "2020-04-16T21:46:03Z")

</div>

Hello,

I am trying to import some logs and configured it with an exclusion line and multiline.  
If I configure just the exclusion its working for this but if I also configure multiline in addition it seems to be ignored as the lines which should be excluded were imported.  
All is send to logstash.

Config:

```auto
filebeat.inputs:
- type: log
  enabled: true
  paths:
    - C:/Logs/**
  exclude_lines: ['^[*]+$']
  multiline.pattern: ^Command start
  multiline.negate: true
  multiline.match: after

```

What I have:

```auto
**********************
Command start time: 20200416214821
**********************
 **********************
Start time: 20200416214819
Username: WORKGROUP\SYSTEM
RunAs User: WORKGROUP\SYSTEM
**********************
True
**********************
 **********************
Command start time: 20200416225643
**********************
 **********************
Start time: 20200416225312
Username: WORKGROUP\SYSTEM
RunAs User: WORKGROUP\SYSTEM
**********************
False
**********************

```

What I try:

- all \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* should be exluded (not working)
- From 'Command start' till the next should be one event (working)

Any idea whats wrong?

Best Regards

---

<div class="post-metadata">

**Author:** ![mtojek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mtojek/32/63863_2.png) [@mtojek](https://discuss.elastic.co/u/mtojek)\
**Post date:** [April 17, 2020, 6:48am UTC](https://discuss.elastic.co/t/exclude-lines-not-working-with-multiline/228411/2 "2020-04-17T06:48:21Z")

</div>

You can try to figure out the best fit for your format using the Grok debugger: [https://grokdebug.herokuapp.com/](https://grokdebug.herokuapp.com/)

---

<div class="post-metadata">

**Author:** ![EliWallic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eliwallic/32/66544_2.png) [@EliWallic](https://discuss.elastic.co/u/EliWallic)\
**Post date:** [April 17, 2020, 6:41pm UTC](https://discuss.elastic.co/t/exclude-lines-not-working-with-multiline/228411/3 "2020-04-17T18:41:03Z")

</div>

Hi,

thanks but I am a little confused. If I use the two links from here: [https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html)

[http://grokdebug.herokuapp.com/](http://grokdebug.herokuapp.com/) - it shows nothing  
[http://grokconstructor.appspot.com/](http://grokconstructor.appspot.com/) - it shows the right matches

---

<div class="post-metadata">

**Author:** ![EliWallic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eliwallic/32/66544_2.png) [@EliWallic](https://discuss.elastic.co/u/EliWallic)\
**Post date:** [April 17, 2020, 9:03pm UTC](https://discuss.elastic.co/t/exclude-lines-not-working-with-multiline/228411/4 "2020-04-17T21:03:00Z")

</div>

Found a solution for me. The regex wasnt correct.

---

<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:** [May 15, 2020, 9:03pm UTC](https://discuss.elastic.co/t/exclude-lines-not-working-with-multiline/228411/5 "2020-05-15T21:03:10Z")

</div>

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