<?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: How come our regular expression is working in search but not configs? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-come-our-regular-expression-is-working-in-search-but-not/m-p/386133#M69309</link>
    <description>&lt;P&gt;Thanks for the help, but I'm still not getting the parsed results. &lt;/P&gt;

&lt;P&gt;To be clear, in case I've done this incorrectly, I put this in the props/transforms for the search app on the search head. Also, do I need to be doing a full restart of the splunk service after the changes are made or is the /debug/refresh sufficient?&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Tue, 12 Feb 2019 21:26:26 GMT</pubDate>
    <dc:creator>clintrajaniemi</dc:creator>
    <dc:date>2019-02-12T21:26:26Z</dc:date>
    <item>
      <title>How come our regular expression is working in search but not configs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-come-our-regular-expression-is-working-in-search-but-not/m-p/386131#M69307</link>
      <description>&lt;P&gt;I have a local administrator cataloging script running on local machines (just mine while testing). The message output in Splunk is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ObjectClass=Group
Name=DOMAIN\AD-SecurityGroup
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I want to break the Name field down into domain and object name. The following works properly:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=windows_test sourcetype="Powershell:LocalAdmins" | rex field=Name "(?&amp;lt;domain&amp;gt;[^\\\\]+)\\\\(?&amp;lt;object_name&amp;gt;[^\"]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I now get in addition to the above:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;domain=DOMAIN
object_name=AD-SecurityGroup
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is exactly what I want, but when I add it to a field extraction on the search head via a transform,  (the only way I could find to parse the specific field) as an unquoted string, it doesn't work. I've removed the 2 extra backslashes from the domain match as well as between the capture groups in case it was only needed in the search box. Still doesn't work. &lt;/P&gt;

&lt;P&gt;In between changes, I've done the debug/refresh as well as restarting the splunkd service on the search head.&lt;/P&gt;

&lt;P&gt;In case it helps, here is the input where the script is running:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[powershell://LocalAdmins]
script = Get-LocalGroupMember -Group "Administrators" | Select-Object ObjectClass,Name
schedule = 60
sourcetype = PowerShell:LocalAdmins
source = PowerShell
index = windows_test
disabled = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On the search head here is the transforms.conf and props.conf:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[PowershellLocalAdmin]
CLEAN_KEYS = 0
REGEX = (?&amp;lt;domain&amp;gt;[^\\\\]+)\\\\(?&amp;lt;object_name&amp;gt;[^\"]+)
SOURCE_KEY = Name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Powershell:LocalAdmins]
REPORT-PowershellLocalAdmins = PowershellLocalAdmin
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm at a loss right now. I need help in determining if there's something wrong with my regex, or the way I'm using it, in the configurations.&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;

&lt;P&gt;Edit:&lt;BR /&gt;
Thanks to chrisyoungerjds and woodcock who each provided a piece of the puzzle I was missing/misunderstanding. Here's what I ended up doing to fix the issue:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[PowerShell:LocalAdmins]
REPORT-PowerShellLocalAdmins = PowerShellLocalAdmins
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[PowerShellLocalAdmins]
CLEAN_KEYS = 0
REGEX = Name=\"(?&amp;lt;domain&amp;gt;[^\\]+)\\(?&amp;lt;object_name&amp;gt;[^\"]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It appears that I can select only one answer as accepted even though each provided a missing piece for me which helped me get to the resolution.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 18:49:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-come-our-regular-expression-is-working-in-search-but-not/m-p/386131#M69307</guid>
      <dc:creator>clintrajaniemi</dc:creator>
      <dc:date>2019-02-12T18:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: How come our regular expression is working in search but not configs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-come-our-regular-expression-is-working-in-search-but-not/m-p/386132#M69308</link>
      <description>&lt;P&gt;Hi @clintrajaniemi &lt;/P&gt;

&lt;P&gt;If you replace this exact string in the transforms.conf it should work: &lt;CODE&gt;REGEX = Name=(?&amp;lt;domain&amp;gt;[^\\]+)\\(?&amp;lt;object_name&amp;gt;[^\"]+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Everything else looks totally correct to me.&lt;/P&gt;

&lt;P&gt;All the best&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 19:05:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-come-our-regular-expression-is-working-in-search-but-not/m-p/386132#M69308</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-02-12T19:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: How come our regular expression is working in search but not configs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-come-our-regular-expression-is-working-in-search-but-not/m-p/386133#M69309</link>
      <description>&lt;P&gt;Thanks for the help, but I'm still not getting the parsed results. &lt;/P&gt;

&lt;P&gt;To be clear, in case I've done this incorrectly, I put this in the props/transforms for the search app on the search head. Also, do I need to be doing a full restart of the splunk service after the changes are made or is the /debug/refresh sufficient?&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 21:26:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-come-our-regular-expression-is-working-in-search-but-not/m-p/386133#M69309</guid>
      <dc:creator>clintrajaniemi</dc:creator>
      <dc:date>2019-02-12T21:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: How come our regular expression is working in search but not configs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-come-our-regular-expression-is-working-in-search-but-not/m-p/386134#M69310</link>
      <description>&lt;P&gt;The problem is that your &lt;CODE&gt;sourcetype&lt;/CODE&gt; values do not match so you have to change one to match the other.  Look at the &lt;CODE&gt;s/S&lt;/CODE&gt; character after &lt;CODE&gt;Power&lt;/CODE&gt; in these 2 lines:&lt;/P&gt;

&lt;P&gt;In your inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype = PowerShell:LocalAdmins
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In your props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Powershell:LocalAdmins]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Feb 2019 01:28:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-come-our-regular-expression-is-working-in-search-but-not/m-p/386134#M69310</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-13T01:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: How come our regular expression is working in search but not configs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-come-our-regular-expression-is-working-in-search-but-not/m-p/386135#M69311</link>
      <description>&lt;P&gt;That's great. Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 13:50:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-come-our-regular-expression-is-working-in-search-but-not/m-p/386135#M69311</guid>
      <dc:creator>clintrajaniemi</dc:creator>
      <dc:date>2019-02-13T13:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: How come our regular expression is working in search but not configs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-come-our-regular-expression-is-working-in-search-but-not/m-p/386136#M69312</link>
      <description>&lt;P&gt;I was able to get this resolved from yours and woodcock's pieces I was missing. Thank you for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 13:51:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-come-our-regular-expression-is-working-in-search-but-not/m-p/386136#M69312</guid>
      <dc:creator>clintrajaniemi</dc:creator>
      <dc:date>2019-02-13T13:51:19Z</dc:date>
    </item>
  </channel>
</rss>

