I am encountering an issue with pipeline configuration where I seem to be unable to drop Syslog messages based on the message contents.
I have done some googling / searching of the forum and the other suggestions don’t seem to be helping.
I am running Graylog 4.1.14-1 on Ubuntu 22.04.1 LTS
An example of the message type I am trying to drop is below:
%CDP-4-DUPLEX_MISMATCH: duplex mismatch discovered on GigabitEthernet1/0/32 (not half duplex), with -Device Name- GigabitEthernet0 (half duplex).
I have created a new pipeline and attached it to the all messages stream with the following rule attached. to the Stage 0 section of the pipeline
rule "Drop CDP Duplex Noise"
when
contains(to_string($message.msg), "duplex mismatch")
then
drop_message();
end
Under the Message processor configuration, I have the default pipeline processor then the message filter chain. I did try reordering them but didn’t have any luck with that.
I wrapped the debug around the drop_message function and I get the following output in the log.
2022-08-12T12:33:13.065+10:00 INFO [Function] PIPELINE DEBUG: Passed value is NULL.
2022-08-12T12:33:13.066+10:00 INFO [Function] PIPELINE DEBUG: Passed value is NULL.
2022-08-12T12:33:13.360+10:00 INFO [Function] PIPELINE DEBUG: Passed value is NULL.
2022-08-12T12:33:14.066+10:00 INFO [Function] PIPELINE DEBUG: Passed value is NULL.
2022-08-12T12:33:15.076+10:00 INFO [Function] PIPELINE DEBUG: Passed value is NULL.
2022-08-12T12:33:15.874+10:00 INFO [Function] PIPELINE DEBUG: Passed value is NULL.
2022-08-12T12:33:16.743+10:00 INFO [Function] PIPELINE DEBUG: Passed value is NULL.
rule "Drop CDP Duplex Noise"
when
contains(to_string($message.message), "duplex mismatch")
then
// use $ tail -f /var/log/graylog-server/server.log to watch for the results of the below debug message
//
debug("_*_*_* - Drop Message rule was hit.");
drop_message();
end
If the debug statement doesn’t appear in your server log then “duplex mismatch” is not being found in the message… check to make sure the pipeline is attached to the correct stream and if it is, are there other pipelines attached to the stream or other rules/stages that run before this one?