I'm having an issue on FreeBSD 14.0 (pfSense 2.7.2) where I want to filter out some unwanted syslog messages. Long story short, I think there's a bug in the Prometheus Node Exporter package, which gives the following unwanted syslog messages each minute:
For the time being, I just want to filter out those messages. I've really done thorough research, and read a number of forum posts here and other places, but I haven't yet found an answer that worked for me (including this one, which I can't get to work).
I initially tried to make a file
But this doesn't work. I also tried:
Which didn't work either.
Can any one point me to a reference on how to filter out syslog messages on FreeBSD, and what the exact syntax is? I would like to be able to understand the official documentation for this with examples, but I don't think it's very clear on suppressing (or redirecting) messages - or at least I can't get the examples to work in my case.
I tried asking on the pfSense forums a week ago, but it seems no one there knows (or wants to share) how to suppress log messages.
Thank you.
Code:
Feb 15 09:53:57 vault node_exporter[25559]: ts=2024-02-15T08:53:57.164Z caller=collector.go:169 level=error msg="collector failed" name=uname duration_seconds=1.9687e-05 err="cannot allocate memory"
Feb 15 09:53:57 vault node_exporter[25559]: ts=2024-02-15T08:53:57.164Z caller=collector.go:169 level=error msg="collector failed" name=zfs duration_seconds=1.6108e-05 err="couldn't get sysctl: no such file or directory"
For the time being, I just want to filter out those messages. I've really done thorough research, and read a number of forum posts here and other places, but I haven't yet found an answer that worked for me (including this one, which I can't get to work).
I initially tried to make a file
01-node-exporter.conf
and put it inside /var/etc/syslog.d/
with the following contents:
Code:
if $msg contains "collector failed" then {
stop
}
But this doesn't work. I also tried:
Code:
:msg, contains, "collector failed" ~
Which didn't work either.
Can any one point me to a reference on how to filter out syslog messages on FreeBSD, and what the exact syntax is? I would like to be able to understand the official documentation for this with examples, but I don't think it's very clear on suppressing (or redirecting) messages - or at least I can't get the examples to work in my case.
I tried asking on the pfSense forums a week ago, but it seems no one there knows (or wants to share) how to suppress log messages.
Thank you.