For example I have the following:
pam_unix(sudo:session): session opened for user root(uid=0) by (uid=997)
pam_unix(sudo:session): session closed for user root
pam_unix(cron:session): session closed for user root
pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
The log files are being flooded with them and was wondering if there was a way to reduce this by not logging this.
It looks like this is just background noise from a session in use?
rsyslogd
. The rsyslog documentation has some examples that do exactly what you're asking (filtering out messages that contain a certain string).