Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Regex/KQL – Parse/Extract from Distinguished Name

In Az Log Analytics, I am wanting to extract information from A DN

cn=User One,OU=Accounts,OU=Administrative,DC=internal,DC=local,DC=com

The goal is to extend to new columns: User = User One, Domain = internal.local.com

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Haven’t been able to find a good example to recreate this from in Kusto.

>Solution :

you could use the parse operator:

print input = 'cn=User One,OU=Accounts,OU=Administrative,DC=internal,DC=local,DC=com'
| parse input with "cn=" User "," * "DC=" d1 ",DC=" d2 ",DC=" d3
| project input, User, Domain = strcat_delim(".", d1, d2, d3)
input User Domain
cn=User One,OU=Accounts,OU=Administrative,DC=internal,DC=local,DC=com User One internal.local.com
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading