I am trying to create a rule that indicates how many users are currently connected to a server.
The message processors are in the following order: Message Filter Chain-Pipeline Processor-AWS Instance Name Lookup-GeoIP Resolver.
There is one stream called login_user for me, and only the ānew sessionā log goes into it.
Now here are the conditions!
When a log containing the string āRemove sessionā comes into āAll messagesā stream, the session number should be extracted from the log.
After that, you need to find the āNew sessionā log in the ālogin_userā stream that matches the session number of āRemove sessionā and delete it.
This is the rule I want, but it may be difficult to satisfy the condition.
If so, I would like to be able to at least delete any one log from the ālogin_userā stream without extracting the session number.
These are the rules Iāve made up a bit.
rule "Remove_Messages"
when
contains(to_string($message.message), ("Removed session"))
then
remove_from_stream("login_user");
end
This rule simply deletes the log containing āRemove sessionā from the ālogin_userā stream.
I also donāt know how to delete a specific message using the āremove_from_streamā function.
I definitely donāt understand the pipeline, and I donāt have the skills to solve this problem.