<?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 Re: Help with rex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex/m-p/102130#M182939</link>
    <description>&lt;P&gt;Splunk should already be extracting the OrgUnit as it is in field=value format. It will call the field OU, but you can set a field alias if you want a different name.  The name is more of a problem, as it contains whitespace.&lt;/P&gt;

&lt;P&gt;To extract them both:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | rex field=_raw "CN=(?&amp;lt;cname&amp;gt;.+?),OU=(?&amp;lt;orgunit&amp;gt;\S+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To extract just the cname:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | rex field=_raw "CN=(?&amp;lt;cname&amp;gt;.+?),"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 18 Jul 2012 16:00:08 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2012-07-18T16:00:08Z</dc:date>
    <item>
      <title>Help with rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex/m-p/102129#M182938</link>
      <description>&lt;P&gt;We are looking to create a multi field rex command to capture the following:&lt;BR /&gt;
 1. Firstname Lastname&lt;BR /&gt;
 2. OrgUnit&lt;/P&gt;

&lt;P&gt;I am having trouble getting the "Firstname Lastname" to parse properly, here is what I have so far:&lt;BR /&gt;
|rex field=_raw "(?) CN=(?&lt;CNAME&gt;[^,]+)"&lt;/CNAME&gt;&lt;/P&gt;

&lt;P&gt;Help is greatly appreciated!&lt;/P&gt;

&lt;P&gt;Here is a raw event:&lt;BR /&gt;
07/18/2012 09:00:29 AM LogName=Security SourceName=Microsoft Windows security auditing. EventCode=4728 EventType=0 Type=Information ComputerName=SERVERNAME.domain.com TaskCategory=Security Group Management OpCode=Info RecordNumber=1688571344 Keywords=Audit Success Message=A member was added to a security-enabled global group. Subject: Security ID:    DOMAIN\test003 Account Name:    test003 Account Domain:     DOMAIN Logon ID:    0x6356e0a1e Member: Security ID:    DOMAIN\LOGONID Account Name:    CN=Firstname Lastname,OU=OrgUnit,OU=Non-Domain Users,OU=People,DC=company,DC=com Group: Security ID:    DOMAIN\SD-INSTALL-ASSET_MANAGEMENT Group Name:  GP-GROUP-GROUPNAME_MANAGEMENT Group Domain:     DOMAIN Additional Information: Privileges:  -&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:06:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex/m-p/102129#M182938</guid>
      <dc:creator>zindain24</dc:creator>
      <dc:date>2020-09-28T12:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-rex/m-p/102130#M182939</link>
      <description>&lt;P&gt;Splunk should already be extracting the OrgUnit as it is in field=value format. It will call the field OU, but you can set a field alias if you want a different name.  The name is more of a problem, as it contains whitespace.&lt;/P&gt;

&lt;P&gt;To extract them both:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | rex field=_raw "CN=(?&amp;lt;cname&amp;gt;.+?),OU=(?&amp;lt;orgunit&amp;gt;\S+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To extract just the cname:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | rex field=_raw "CN=(?&amp;lt;cname&amp;gt;.+?),"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jul 2012 16:00:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-rex/m-p/102130#M182939</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-07-18T16:00:08Z</dc:date>
    </item>
  </channel>
</rss>

