I would like to configure a stream so that it necessarily matches with a rule (the source of this stream), and that it necessarily matches with one of the other two rules that I have set up (because I would like that only two types of messages appear). But I don’t know how to do it since either the stream must match with all the rules or it is enough that only one of the three match rules, which does not suit me either. Does anyone know how to do that?
@shoothub Not really, it’s something that is present in the two field messages of the logs I want to filter. My goal here is to say "all logs that come from Serveur03 and that have “key=” or “cwd=” in the field messages go into the stream “Syslog commands logs”.
If you want to find fields directly in message field, you can use this pipeline rule:
rule "msg"
when
contains(to_string($message.message), "key=") OR
contains(to_string($message.message), "cwd=")
then
route_to_stream(name: "Syslog commands logs");
end
rule "Server03_root_commands"
when
contains(to_string($message.source), "Server03") AND
(contains(to_string($message.message), "key=") OR
contains(to_string($message.message), "cwd="))
then
route_to_stream (name: "Syslog commands logs", remove_from_default: true);
end