schurd
(Dietmar Schurr)
June 28, 2017, 12:03pm
1
Hello All,
following rule should just drop the message if the log level is “7”:
rule "drop_level7_netscaler"
when
syslog_level($message.level) == "7"
then
drop_message();
end
Somehow this does not work.
Yes, the rule is part of a pipeline, which is attached to a stream.
I use Graylog 2.2.3.
The pipeline processor is active.
Thanks in advance for any help.
Best regards,
Dietmar Schur
maniel
(Daniel)
June 28, 2017, 12:23pm
2
is the message level field set by extractor? if so, then you have to change message processors order in System / Configurations
and move the Pipeline Processor
to the end, after Message Filter Chain
schurd
(Dietmar Schurr)
June 28, 2017, 12:31pm
3
Hallo Maniel,
thanks for the quick reply.
Yes, if I swtich the order in
Message Processors Configuration
to:
1 GeoIP Resolver disabled
2 Message Filter Chain active
3 Pipeline Processor active
Then I get some throughput in the puipeline. This was always 0 before this change.
Before, the Pipeline Processor was second (2).
But in the respective stream I see lots of messages which should be dropped by the rule.
What is here missing?
What does drop_message() do? Does it really drop the message from all streams, once and for ever?
Best regards,
Dietmar Schurr
jochen
(Jochen)
June 28, 2017, 12:33pm
4
The syslog_level()
function converts the syslog severity number into its string representation, so syslog_level(7)
will yield "Debug"
.
You could simply check the value of $message.level
instead of using the syslog_level()
function.
schurd
(Dietmar Schurr)
June 28, 2017, 12:44pm
5
Hello Jochen,
thank you very much. The problem is solved.
The working rule is:
rule "drop_level7_netscaler"
when
to_string($message.level) == "7"
then
drop_message();
end
Also I needed to switch the Messages Processor Configuration.
Now the Stream gets no more level 7 messages.
Great
Best regards,
Dietmar Schurr
jochen
(Jochen)
June 28, 2017, 1:04pm
6
And even the to_string()
method is not necessary if you compare to the numeric value.
schurd
(Dietmar Schurr)
June 28, 2017, 1:16pm
7
Hello Jooochen,
but
rule "drop_level7_netscaler"
when
$message.level == 7
then
drop_message();
end
does not work. The messages are not dropped.
Regards,
Dietmar
schurd
(Dietmar Schurr)
June 28, 2017, 1:23pm
8
Hello,
the rule:
rule "drop_level7_netscaler"
when
to_long($message.level) > 5
then
drop_message();
end
works well and filters all messages with level higher than 5.
Regards,
Dietmar
system
(system)
Closed
July 12, 2017, 1:24pm
9
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.