change:
if $msg contains "received client metadata" then /var/log/fmfiltered
to
if $msg contains "received client metadata" then {
    /var/log/fmfiltered
    stop
}

without the stop, the log is still processed by everything else in the config (so it can be written in multiple places)

David Lang


On Thu, 21 Nov 2019, François Meehan via rsyslog wrote:

Date: Thu, 21 Nov 2019 13:54:44 -0500
From: François Meehan via rsyslog <[email protected]>
To: [email protected]
Cc: François Meehan <[email protected]>
Subject: [rsyslog] Filtering messages

Hi all,

I am trying to get rid of an annoying informational entry in syslog.

2019-11-21T14:33:27Z mongod.27019[23461]: [conn4] received client metadata
from 127.0.0.1:45234 conn4: { driver: { name: "nodejs", version: "2.2.9" },
os:" etc.etc. }

This is produced by Mongodb running in a ``snap`` package, and is repeated
every 10 seconds.

Setting rsyslog to send content to another file works,

if $msg contains "received client metadata" then /var/log/fmfiltered

Unfortunately that does not remove original entries in syslog.

Is there a way to redirect messages to another file without having them in
syslog?

Best regards,


Francois

*François Meehan*
[email protected]
514 816-5869
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to