<?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: extract from source path not working in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/extract-from-source-path-not-working/m-p/28315#M5597</link>
    <description>&lt;P&gt;Your initial regex featured a caret (^) in the initial position meaning "start at the beginning of the string" in regex-ese.  Since the paths begin with D:\, your regex wasn't going to match.  Glad to see you've got it working.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Aug 2012 01:02:38 GMT</pubDate>
    <dc:creator>sowings</dc:creator>
    <dc:date>2012-08-08T01:02:38Z</dc:date>
    <item>
      <title>extract from source path not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-from-source-path-not-working/m-p/28312#M5594</link>
      <description>&lt;P&gt;I tried to follow the directions &lt;A href="http://splunk-base.splunk.com/answers/10767/extract-field-from-sources-file-path" title="here" target="_blank"&gt;here&lt;/A&gt; to extract a field from the source path of my directory -- but i cant seem to get it working.  &lt;/P&gt;

&lt;P&gt;At the end of the post it says to add&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;EXTRACT-ws_component = ^/([^/]+)$ in source&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;
to my props.conf file.  since this is a windows machine, I changed the backslash (/) to escaped forward slash (\\) and I end up with this&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;EXTRACT-ws_component = ^\\([^\\]+)$ in source'&lt;/CODE&gt;  &lt;/P&gt;

&lt;P&gt;Then when I go into search, my new field does not show up.&lt;/P&gt;

&lt;P&gt;In the end I want to extract a field from pathname of the files  A sample of the pathanmes is like so:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;D:\extract\stressTest\hkln288p\WLS_ATH1\logs\out.log  
D:\extract\stressTest\hkln288p\WLS_CMB_NA1\logs\out.log  
D:\extract\stressTest\hkln289p\WLS_ATH2\logs\out.log  
D:\extract\stressTest\hkln289p\WLS_ATH\logs\out.log  
D:\extract\stressTest\hkln289p\WLS_CMB_BAC2\logs\out.log 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where the field I want to extract is the WLS_* section:  WLS_ATH1, WLS_ATH2... etc&lt;/P&gt;

&lt;P&gt;how do I accomplish this?  &lt;/P&gt;

&lt;P&gt;lastly -- please excuse any oversights here, ive only been using splunk for a few days.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:12:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-from-source-path-not-working/m-p/28312#M5594</guid>
      <dc:creator>kittle</dc:creator>
      <dc:date>2020-09-28T12:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: extract from source path not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-from-source-path-not-working/m-p/28313#M5595</link>
      <description>&lt;P&gt;You could try the following in props.conf for the sourcetype in question.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
EXTRACT-wls = \\WLS_(?&amp;lt;ZZZ&amp;gt;[A-Z0-9_]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;should give you a new field called ZZZ which would contain the various WLS_* (but not the leading &lt;CODE&gt;WLS_&lt;/CODE&gt; part, i.e &lt;CODE&gt;ATH, ATH2, CMB_BAC2&lt;/CODE&gt; etc)&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;K&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:12:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-from-source-path-not-working/m-p/28313#M5595</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2020-09-28T12:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: extract from source path not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-from-source-path-not-working/m-p/28314#M5596</link>
      <description>&lt;P&gt;Thanks - that was enough to get it working.   note the line MUST read &lt;CODE&gt;EXTRACT-wls = \\WLS_(?&amp;lt;ZZZ&amp;gt;[A-Z0-9_]+) in source&lt;/CODE&gt;  in order to work properly&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2012 23:44:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-from-source-path-not-working/m-p/28314#M5596</guid>
      <dc:creator>kittle</dc:creator>
      <dc:date>2012-08-07T23:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: extract from source path not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-from-source-path-not-working/m-p/28315#M5597</link>
      <description>&lt;P&gt;Your initial regex featured a caret (^) in the initial position meaning "start at the beginning of the string" in regex-ese.  Since the paths begin with D:\, your regex wasn't going to match.  Glad to see you've got it working.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2012 01:02:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-from-source-path-not-working/m-p/28315#M5597</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2012-08-08T01:02:38Z</dc:date>
    </item>
  </channel>
</rss>

