# Include\_lines and exclude\_lines not working as expected

**URL:** <https://discuss.elastic.co/t/include-lines-and-exclude-lines-not-working-as-expected/175815>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 8, 2019, 10:16am UTC](https://discuss.elastic.co/t/include-lines-and-exclude-lines-not-working-as-expected/175815 "2019-04-08T10:16:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![avj1986](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/avj1986/32/42478_2.png) [@avj1986](https://discuss.elastic.co/u/avj1986)\
**Post date:** [April 8, 2019, 10:16am UTC](https://discuss.elastic.co/t/include-lines-and-exclude-lines-not-working-as-expected/175815/1 "2019-04-08T10:16:02Z")

</div>

Hi,

I want to exclude a few lines from logs before sending it to logstash (6.6) from Filebeat.  
Here is my filebeat.conf:

```
filebeat.inputs:
- type: log
  paths: 
        - /Users/amit_joshi5/ElasticData/spool/FileReader*.log
  fields: 
        log_type: detectionLogs
        
- type: log 
  paths:
        - /Users/amit_joshi5/ElasticData/spool/FileCsv*.csv
  fields:
        log_type: perfMonLogs

include_lines: ['^FINEST']
exclude_lines: ['^DEBUG']

output.logstash:
  hosts: ["localhost:5044"]

```

Snippet from Logs:

```
FINEST: com.jacob.systemio.node FileUpload File: l:\test10\ntlm1.pcap DownloadByteContentSize: 1232 Time taken: 3
DEBUG: com.jacob.systemio.node FileUpload File: l:\test10\ntlm2.pcap DownloadByteContentSize: 213123 Time taken: 2
DEBUG: com.jacob.systemio.node FileUpload File: l:\test10\ntlm4.pcap DownloadByteContentSize: 12312 Time taken: 3
DEBUG: com.jacob.systemio.node FileUpload File: l:\test10\ntlm3.pcap DownloadByteContentSize: 5676 Time taken: 3
DEBUG: com.jacob.systemio.node FileUpload File: l:\test10\ntlm5.pcap DownloadByteContentSize: 4564 Time taken: 3
DEBUG: com.jacob.systemio.node FileUpload File: l:\test10\ntlm.pcap DownloadByteContentSize: 456 Time taken: 5
DEBUG: com.jacob.systemio.node FileUpload File: l:\test10\ntl11.pcap DownloadByteContentSize: 456 Time taken: 6

```

Based on configuration, it is expected to post only first line to logstash, however, it is posting all the log lines.  
I tried multiple things and combinations with include and exclude filter, but none of them worked.  
The only intention is to send filtered data to logstash.

---

<div class="post-metadata">

**Author:** ![avj1986](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/avj1986/32/42478_2.png) [@avj1986](https://discuss.elastic.co/u/avj1986)\
**Post date:** [April 9, 2019, 3:22am UTC](https://discuss.elastic.co/t/include-lines-and-exclude-lines-not-working-as-expected/175815/2 "2019-04-09T03:22:00Z")

</div>

Any clues ?

---

<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 7, 2019, 3:22am UTC](https://discuss.elastic.co/t/include-lines-and-exclude-lines-not-working-as-expected/175815/3 "2019-05-07T03:22:12Z")

</div>

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