<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to achieve field extraction to list domain admins from AD logs? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605673#M210624</link>
    <description>&lt;P&gt;I have been trying to extract a field to list domain admins from AD logs. The logs have all the admins starting with a CN= as shown in the expression. Despite working on regex101, the expression won't extract on Splunk. I've tried making little modifications but to no avail. Please help.&lt;/P&gt;
&lt;P&gt;Expression:&lt;/P&gt;
&lt;P&gt;source="ActiveDirectory" AND "CN=Domain Admins" AND member=*&lt;/P&gt;
&lt;P&gt;| rex field=_raw"(?&amp;lt;=CN=)[\w .]*(?=,)(?&amp;lt;admin&amp;gt;)/g"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The logs look similar to this:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;CN=Admin Account&lt;/SPAN&gt;,&lt;SPAN class=""&gt;OU=Vendor&lt;/SPAN&gt; &lt;SPAN class=""&gt;Accounts&lt;/SPAN&gt;,&lt;SPAN class=""&gt;OU=IT&lt;/SPAN&gt;,&lt;SPAN class=""&gt;DC=domain&lt;/SPAN&gt;,&lt;SPAN class=""&gt;DC=domain&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jul 2022 20:13:09 GMT</pubDate>
    <dc:creator>ggilmore1</dc:creator>
    <dc:date>2022-07-14T20:13:09Z</dc:date>
    <item>
      <title>How to achieve field extraction to list domain admins from AD logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605673#M210624</link>
      <description>&lt;P&gt;I have been trying to extract a field to list domain admins from AD logs. The logs have all the admins starting with a CN= as shown in the expression. Despite working on regex101, the expression won't extract on Splunk. I've tried making little modifications but to no avail. Please help.&lt;/P&gt;
&lt;P&gt;Expression:&lt;/P&gt;
&lt;P&gt;source="ActiveDirectory" AND "CN=Domain Admins" AND member=*&lt;/P&gt;
&lt;P&gt;| rex field=_raw"(?&amp;lt;=CN=)[\w .]*(?=,)(?&amp;lt;admin&amp;gt;)/g"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The logs look similar to this:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;CN=Admin Account&lt;/SPAN&gt;,&lt;SPAN class=""&gt;OU=Vendor&lt;/SPAN&gt; &lt;SPAN class=""&gt;Accounts&lt;/SPAN&gt;,&lt;SPAN class=""&gt;OU=IT&lt;/SPAN&gt;,&lt;SPAN class=""&gt;DC=domain&lt;/SPAN&gt;,&lt;SPAN class=""&gt;DC=domain&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 20:13:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605673#M210624</guid>
      <dc:creator>ggilmore1</dc:creator>
      <dc:date>2022-07-14T20:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to achieve field extraction to list domain admins from AD logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605675#M210625</link>
      <description>&lt;P&gt;Cut the "/g" part from&amp;nbsp; your regex unless your event contains such substring. I suppose it doesn't. That's one thing.&lt;/P&gt;&lt;P&gt;Another is that you have a capture group named "admin" but nothing to match in this group.&lt;/P&gt;&lt;P&gt;What do you want to match? Matching such strings can be tricky especially if you want to account for all the border cases.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 20:35:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605675#M210625</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-07-14T20:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to achieve field extraction to list domain admins from AD logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605676#M210626</link>
      <description>&lt;P&gt;Ideally, I would like to match all CN=Admin Account. My goal is to make a table with the admin accounts&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 20:38:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605676#M210626</guid>
      <dc:creator>ggilmore1</dc:creator>
      <dc:date>2022-07-14T20:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to achieve field extraction to list domain admins from AD logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605684#M210629</link>
      <description>&lt;P&gt;Easiest approach to this would be something like&lt;/P&gt;&lt;PRE&gt;CN=(?&amp;lt;cn&amp;gt;[^,]+),&lt;/PRE&gt;&lt;P&gt;This way you're capturing everything between 'CN=' and a comma.&lt;/P&gt;&lt;P&gt;One caveat - if your CN contains literal comma (and I don't know if your logs should have it escaped in any way or not), only the part up to and not including the comma would be captured.&lt;/P&gt;&lt;P&gt;Assuming that there has to be another component of the DN, you can try to use this information like this:&lt;/P&gt;&lt;PRE&gt;CN=(?&amp;lt;cn&amp;gt;.*?),\w+=&lt;/PRE&gt;&lt;P&gt;In this case however you'd have problem if your CN included a ",SOMETHING=" string but it's sooooooo unlikely&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 21:26:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605684#M210629</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-07-14T21:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to achieve field extraction to list domain admins from AD logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605687#M210630</link>
      <description>&lt;P&gt;I tried the first one and it works well. The problem is it seems to stop after the first one and I can't get it to repeat. Unfortunately I am pretty new to the world of regex&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 21:41:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605687#M210630</guid>
      <dc:creator>ggilmore1</dc:creator>
      <dc:date>2022-07-14T21:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to achieve field extraction to list domain admins from AD logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605691#M210632</link>
      <description>&lt;P&gt;What do you mean by "stops after the first one"? Do your events contain multiple DNs per event? If so, add max_match=0 option to your rex command.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 22:02:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605691#M210632</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-07-14T22:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to achieve field extraction to list domain admins from AD logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605698#M210634</link>
      <description>&lt;P&gt;What I mean is the logs are like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;CN=Admin Account&lt;/SPAN&gt;,&lt;SPAN class=""&gt;OU=Vendor&lt;/SPAN&gt; &lt;SPAN class=""&gt;Accounts&lt;/SPAN&gt;,&lt;SPAN class=""&gt;OU=IT&lt;/SPAN&gt;,&lt;SPAN class=""&gt;DC=domain&lt;/SPAN&gt;,&lt;SPAN class=""&gt;DC=domain&lt;/SPAN&gt;|&lt;SPAN class=""&gt;CN=Admin Account2&lt;/SPAN&gt;,&lt;SPAN class=""&gt;OU=Vendor&lt;/SPAN&gt; &lt;SPAN class=""&gt;Accounts&lt;/SPAN&gt;,&lt;SPAN class=""&gt;OU=IT&lt;/SPAN&gt;,&lt;SPAN class=""&gt;DC=domain&lt;/SPAN&gt;,&lt;SPAN class=""&gt;DC=domain&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;And the command stops after the first one.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 22:12:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605698#M210634</guid>
      <dc:creator>ggilmore1</dc:creator>
      <dc:date>2022-07-14T22:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to achieve field extraction to list domain admins from AD logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605700#M210635</link>
      <description>&lt;P&gt;With max_match=0 you should get the field extracted as multivalued field.&lt;/P&gt;&lt;PRE&gt;&amp;lt;your search&amp;gt;&lt;BR /&gt;| rex max_match=0 "CN=(?&amp;lt;cn&amp;gt;.*?),\w+="&lt;/PRE&gt;&lt;P&gt;With this regex or with the other one.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 22:16:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605700#M210635</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-07-14T22:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to achieve field extraction to list domain admins from AD logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605701#M210636</link>
      <description>&lt;P&gt;That's the one. Thank you sir for bearing with me&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 22:16:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-achieve-field-extraction-to-list-domain-admins-from-AD/m-p/605701#M210636</guid>
      <dc:creator>ggilmore1</dc:creator>
      <dc:date>2022-07-14T22:16:52Z</dc:date>
    </item>
  </channel>
</rss>

