I am creating a Splunk alert for Active Directory events when anything gets moved. I am having troubles with implementing regex on the search.
So I created a regex like this:
=(\b\w+.\w?.?.?\w+\s?\w+),(?:.?.?.?)(\w+\s?\w+),(?:.?.?.?)(\w+\s?\w+),(?:.?.?.?)(\w+\s?\w+)
It's not really working like I would like to. The sample data I am working with looks like this:
CN=User Test,OU=Admins,OU=Users,OU=Test,OU=12Test Test,DC=test,DC=test12,DC=test,DC=test
CN=User T. Test ADM,OU=Users,OU=Test,OU=Test,DC=test12,DC=test,DC=abc,DC=test
The issue is I need to ignore CN=
and the OU=
and only get the strings afterwards with ignoring anything after DC=
and extract those values as a variable or an accessible string.
For Example I'd want my output to look like this in the alert
User Account <CN= String> moved from <12Test> <Test> <Users>