How can I just keep the account name?
I tried with replace, but that didn't work, the way I want
Here is the search that I am using:
| makeresults
| eval Member="
CN=Domain Admins,OU=Users,DC=Lab,DC=com
CN=Account Report,OU=Users,DC=Lab,DC=com
CN=Report,OU=Users,DC=Lab,DC=com
CN=HelpDesk,OU=Users,DC=Lab,DC=com
"
|eval change=replace(Member,"CN=","")
| table Member,change
My goal is to keep the name of the account only, to be like:
Domain Admins
Account Report
Report
HelpDesk
Thanks in advance,
I added field=Member before max_match and it worked
| rex max_match=0 "CN=(?<account>[^,]+),"
Thanks @ITWhisperer .
Should I add the name of my field in there like this:
| makeresults
| eval Member="CN=Domain Admins,OU=Groups,OU=Admin,DC=eu,DC=dsext,DC=susq,DC=com
CN=Enterprise Admins,OU=Groups,OU=Admin,DC=eu,DC=dsext,DC=susq,DC=com
CN=LNSS_MONITOR_USR,CN=Users,DC=eu,DC=dsext,DC=susq,DC=com
CN=backupacct,OU=Admin,DC=eu,DC=dsext,DC=susq,DC=com"
| rex max_match=0 "CN=(?<Member>[^,]+),"