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.