rule "Drop4624MachineAccounts"
when
((to_string($message.EventID) == "4624"))
AND
(contains(to_string($message.TargetUserName),to_string("$"),true))
then
drop_message();
end
I am using gelf to ingest windows security log.
I would like to drop specific events, in this case event 4624 whenever TargetUserName field contains a compyter account, A computer account has $ symbol at the end like
PC01$
I have tried using the contain function but it’s not working.
I have updated the Pipeline rule, however i still see events with computername
rule "Drop4624MachineAccounts"
when
((to_string($message.EventID) == "4624"))
AND
(contains(to_string($message.TargetUserName),"/$",true))
then
drop_message();
end
Hi Jan,
this is what worked for me. Thanks for you assistance in getting this sorted out.
rule "Drop4624MachineAccounts"
when
// (has_field("EventID") AND (to_string($message.EventID) == "4624"))
// Original - Now Commented
(has_field("EventID") AND (to_string($message.EventID) == "4624")) AND to_bool(regex("([a-zA-Z0-9])+\\$",to_string($message.TargetUserName)).matches)
then
drop_message();
end