Hi,
I am using FreeBSD 15.0 (pfSense 14.11) and I want to suppress/exclude certain syslog messages.
Specifically I do not want to log SSH-logins from a dedicated host as this is my Check_MK server and the SSH-login is a standard check of the Check_MK system.
The log message is: "Connection closed by xxx.xxx.xxx.xxx port xxxxxx [preauth]"
I create a file a.conf in /var/etc/syslog.d/ with the following content:
I played around with the content of the file, i.e. using ".*" asterisks, removing the "!" at contains, etc.
pfSense automatically generates the syslog-config based on the GUI. The corresponding file in /var/etc/syslog.d/ is pfSense.conf. By default, pfSense logs all auth.*;authpriv.*-events to /var/log/auth.log.
I stopped the syslog daemon, deleted the pfSense.conf file and restarted the service. By this, I hoped that the a.conf is used first and the sshd-message is suppressed in /var/log/auth.log
So far, I was not successful.
First of all, I need to verify that I am using the right syntax to exclude certain messages. Any hints here?
I am using FreeBSD 15.0 (pfSense 14.11) and I want to suppress/exclude certain syslog messages.
Specifically I do not want to log SSH-logins from a dedicated host as this is my Check_MK server and the SSH-login is a standard check of the Check_MK system.
The log message is: "Connection closed by xxx.xxx.xxx.xxx port xxxxxx [preauth]"
I create a file a.conf in /var/etc/syslog.d/ with the following content:
Code:
!sshd
:msg, !contains, "Connection closed by xxx.xxx.xxx.xxx"
I played around with the content of the file, i.e. using ".*" asterisks, removing the "!" at contains, etc.
pfSense automatically generates the syslog-config based on the GUI. The corresponding file in /var/etc/syslog.d/ is pfSense.conf. By default, pfSense logs all auth.*;authpriv.*-events to /var/log/auth.log.
I stopped the syslog daemon, deleted the pfSense.conf file and restarted the service. By this, I hoped that the a.conf is used first and the sshd-message is suppressed in /var/log/auth.log
Code:
# Automatically generated, do not edit!
!*
auth.*;authpriv.* /var/log/auth.log
!radvd
*.err /var/log/routing.log
!routed,zebra,ospfd,ospf6d,bgpd,watchfrr,miniupnpd,igmpproxy
*.* /var/log/routing.log
!ntp,ntpd,ntpdate
*.* /var/log/ntpd.log
!ppp
*.* /var/log/ppp.log
!poes
*.* /var/log/poes.log
!l2tps
*.* /var/log/l2tps.log
!charon,ipsec_starter
*.* /var/log/ipsec.log
!openvpn
*.* /var/log/openvpn.log
!dpinger
*.* /var/log/gateways.log
!dnsmasq,named,filterdns,unbound
*.* /var/log/resolver.log
!dhcpd,dhcrelay,dhclient,dhcp6c,dhcpleases,dhcpleases6,kea2unbound,kea-dhcp4,kea-dhcp6
*.* /var/log/dhcpd.log
!hostapd
*.* /var/log/wireless.log
!filterlog
*.* /var/log/filter.log
!logportalauth
*.* /var/log/portalauth.log
!watchdogd
*.* /var/log/watchdogd.log
!-bgpd,charon,dhclient,dhcp6c,dhcpd,dhcrelay,dnsmasq,dpinger,filterdns,filterlog,hostapd,igmpproxy,ipsec_starter,kea-dhcp4,kea-dhcp6,unbound,kea2unbound,l2tps,miniupnpd,named,ntp,ntpd,ntpdate,openvpn,ospf6d,ospfd,poes,radvd,routed,watchfrr,zebra,udpbroadcastrelay
local3.* /var/log/vpn.log
local5.* /var/log/nginx.log
*.notice;kern.debug;lpr.info;mail.crit;daemon.none;news.err;local0.none;local3.none;local4.none;local7.none;security.*;auth.info;authpriv.info;daemon.info /var/log/system.log
*.emerg *
So far, I was not successful.
First of all, I need to verify that I am using the right syntax to exclude certain messages. Any hints here?