# Howto filter logs for Facility and Priority

**URL:** <https://discuss.elastic.co/t/howto-filter-logs-for-facility-and-priority/209573>\
**Category:** Beats\
**Tags:** beats-module, filebeat\
**Created:** [November 26, 2019, 7:33pm UTC](https://discuss.elastic.co/t/howto-filter-logs-for-facility-and-priority/209573 "2019-11-26T19:33:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robur314](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@robur314](https://discuss.elastic.co/u/robur314)\
**Post date:** [November 26, 2019, 7:33pm UTC](https://discuss.elastic.co/t/howto-filter-logs-for-facility-and-priority/209573/1 "2019-11-26T19:33:11Z")

</div>

Hi all,  
I'm evaluating  
filebeat version 7.4.2 with elasticsearch (same version)  
and the system module.

How can I filter the the log messages for facility and priority fields?  
Can I tweak/configure the filebeat system module to extract them?

I turned this fields on in rsyslog.conf with a simple filter like so:

$template TraditionalFormatWithPRI,"%pri-text%: %timegenerated% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n"

$ActionFileDefaultTemplate TraditionalFormatWithPRI

resulting in loglines lookinig like this:

daemon.info: Nov 26 20:15:02 myhost systemd[1]: Started Hostname Service.

but they are just cleanly filtered out when I look at the line in kibana.  
I used to think it's quite helpful to have a filter at least for the priority!

Any way to achieve this with the system module?

TIA

---

<div class="post-metadata">

**Author:** ![robur314](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@robur314](https://discuss.elastic.co/u/robur314)\
**Post date:** [November 29, 2019, 1:31pm UTC](https://discuss.elastic.co/t/howto-filter-logs-for-facility-and-priority/209573/2 "2019-11-29T13:31:30Z")

</div>

I was able to extract the facility and priority fields from above mentioned logline by editing:

/usr/share/filebeat/module/system/syslog/ingest/pipeline.json

and than updating the actual pipline with:

curl -H 'Content-Type: application/json' -XPUT 'http://\<elk\_ip\>:9200/\_ingest/pipeline/filebeat-7.4.2-systemsystem' -d@pipeline.json

see here for more info:  
[https://www.elastic.co/guide/en/beats/filebeat/master/configuring-ingest-node.html](https://www.elastic.co/guide/en/beats/filebeat/master/configuring-ingest-node.html)  
[https://www.elastic.co/guide/en/beats/filebeat/current/elasticsearch-output.html](https://www.elastic.co/guide/en/beats/filebeat/current/elasticsearch-output.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:** [December 27, 2019, 1:31pm UTC](https://discuss.elastic.co/t/howto-filter-logs-for-facility-and-priority/209573/3 "2019-12-27T13:31:36Z")

</div>

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