# Include only error

**URL:** <https://discuss.elastic.co/t/include-only-error/221282>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [February 27, 2020, 4:51pm UTC](https://discuss.elastic.co/t/include-only-error/221282 "2020-02-27T16:51:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![armani\_ani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armani_ani/32/55455_2.png) [@armani\_ani](https://discuss.elastic.co/u/armani_ani)\
**Post date:** [February 27, 2020, 4:51pm UTC](https://discuss.elastic.co/t/include-only-error/221282/1 "2020-02-27T16:51:59Z")

</div>

Hi , I am using filebeat 7.6  
with the below filebeat config

logging.level: error  
filebeat.inputs:

- type: syslog  
protocol.tcp.host: "localhost:5000"

include\_lines: ['error']

I would like for example to include only error or warning message and exclude info message on syslog.

Feb 27 17:30:02 SERVER filebeat[32050]: Exiting: error loading config file: yaml: line 23: did not find expected key  
Feb 27 17:30:02 SERVER systemd[1]: filebeat.service: Main process exited, code=exited, status=1/FAILURE  
Feb 27 17:30:02 SERVE\>R systemd[1]: filebeat.service: Unit entered failed state.  
Feb 27 17:30:02 SERVER systemd[1]: filebeat.service: Failed with result 'exit-code'.  
Feb 27 17:30:02 SERVER systemd[1]: filebeat.service: Service hold-off time over, scheduling restart.  
Feb 27 17:30:02 SERVER systemd[1]: Stopped Filebeat sends log files to Logstash or directly to Elasticsearch..

But still not work i still receive all events.

Any idea why didn't work ?

Thanks

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [February 28, 2020, 9:20am UTC](https://discuss.elastic.co/t/include-only-error/221282/2 "2020-02-28T09:20:50Z")

</div>

Hi!

From `Exiting: error loading config file: yaml: line 23: did not find expected key` it seems that your configuration yml is not valid. Please to try to validate it before using it. There are plenty of yml validator online to use.

C.

---

<div class="post-metadata">

**Author:** ![armani\_ani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armani_ani/32/55455_2.png) [@armani\_ani](https://discuss.elastic.co/u/armani_ani)\
**Post date:** [February 28, 2020, 11:03am UTC](https://discuss.elastic.co/t/include-only-error/221282/3 "2020-02-28T11:03:26Z")

</div>

Hi ,

thanks for you reply .

i have already correct the line on filebeat.yml , the filebeat client work fine.

filebeat.service - Filebeat sends log files to Logstash or directly to Elasticsearch.  
Loaded: loaded (/lib/systemd/system/filebeat.service; disabled; vendor preset: enabled)  
Active: active (running) since Thu 2020-02-27 17:43:49 CET; 18h ago  
Docs: [https://www.elastic.co/products/beats/filebeat](https://www.elastic.co/products/beats/filebeat)  
Main PID: 32381 (filebeat)  
Tasks: 10 (limit: 4915)  
CGroup: /system.slice/filebeat.service  
└─32381 /usr/share/filebeat/bin/filebeat -e -c /etc/filebeat/filebeat.yml -path.home /usr/share/filebeat -path.config /etc/filebeat -path.data /var/lib/filebeat -path.logs /var/log/filebeat

I still receive all line from syslog client, i would like to ship only error but the include\_lines doesn't seem to work .

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [February 28, 2020, 2:30pm UTC](https://discuss.elastic.co/t/include-only-error/221282/4 "2020-02-28T14:30:13Z")

</div>

Could you provide your full configuration please?

---

<div class="post-metadata">

**Author:** ![armani\_ani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/armani_ani/32/55455_2.png) [@armani\_ani](https://discuss.elastic.co/u/armani_ani)\
**Post date:** [February 28, 2020, 4:12pm UTC](https://discuss.elastic.co/t/include-only-error/221282/5 "2020-02-28T16:12:41Z")

</div>

now it work with the following config 🙂  
#=========================== Filebeat inputs =============================  
logging.level: error  
filebeat.inputs:

- type: syslog  
protocol.tcp.host: "localhost:5000"  
processors:
- drop\_event.when.not.regexp.message: "error"

quick question how i can match multiple words for example ( "error","warning","Failure") .

i try :  
processors:

- drop\_event.when.not.regexp.message: ['error','failure']  
but doesn't work .

thx

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [March 4, 2020, 7:21am UTC](https://discuss.elastic.co/t/include-only-error/221282/6 "2020-03-04T07:21:25Z")

</div>

Hey.

Maybe you can use an `or` condition: [https://www.elastic.co/guide/en/beats/filebeat/master/defining-processors.html#condition-or](https://www.elastic.co/guide/en/beats/filebeat/master/defining-processors.html#condition-or)

---

<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:** [April 1, 2020, 7:21am UTC](https://discuss.elastic.co/t/include-only-error/221282/7 "2020-04-01T07:21:25Z")

</div>

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