I’m making my way into pipeline rules and graylog features.
I want to know if it’s possible to put a list of servers into a lookup table and then match one of this value into my pipeline rule.
For a single server i have this rule that works as it should :
Rule “Name of my rule”
When
to_string($message.source) == “A SERVER”
then
route_to_stream(id: “ID of my stream”);
end
What i want is to get not one but multiple choices that the source of my message could match.
How should i process ?
And use pipeline rule to route to stream based on CSV file
rule "Route to stream from csv"
when
is_not_null(lookup_value("servers", to_string($message.source)))
then
let output_stream = lookup_value("server", to_string($message.source));
// let debug_message = concat("Stream: ", to_string(output_stream));
// debug(debug_message);
route_to_stream(name: to_string(output_stream));
end