<?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 rex regex to extract first folder name from the path in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rex-regex-to-extract-first-folder-name-from-the-path/m-p/287508#M87042</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;My source filed has value such as,&lt;/P&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;/icsws&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;/log/INSTANCE1/was/base/icsws_ca_server/SystemOut.log&lt;/EM&gt;*&lt;BR /&gt;
/icsws*&lt;STRONG&gt;&lt;EM&gt;/log/INSTANCE1/ihs/access_log&lt;BR /&gt;
/wcics&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;/log/INSTANCE1/ihs/access_log&lt;BR /&gt;
...&lt;BR /&gt;
...&lt;/EM&gt;*&lt;/P&gt;

&lt;P&gt;I would like to extract the first folder names (icsws*&lt;STRONG&gt;&lt;EM&gt;, wcics&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;) from above to field named VAH. &lt;BR /&gt;
can someone help me complete   *&lt;/EM&gt;| rex field=source ".."**&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Simon Mandy&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 09:53:51 GMT</pubDate>
    <dc:creator>sim_tcr</dc:creator>
    <dc:date>2020-09-29T09:53:51Z</dc:date>
    <item>
      <title>rex regex to extract first folder name from the path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-regex-to-extract-first-folder-name-from-the-path/m-p/287508#M87042</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;My source filed has value such as,&lt;/P&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;/icsws&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;/log/INSTANCE1/was/base/icsws_ca_server/SystemOut.log&lt;/EM&gt;*&lt;BR /&gt;
/icsws*&lt;STRONG&gt;&lt;EM&gt;/log/INSTANCE1/ihs/access_log&lt;BR /&gt;
/wcics&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;/log/INSTANCE1/ihs/access_log&lt;BR /&gt;
...&lt;BR /&gt;
...&lt;/EM&gt;*&lt;/P&gt;

&lt;P&gt;I would like to extract the first folder names (icsws*&lt;STRONG&gt;&lt;EM&gt;, wcics&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;) from above to field named VAH. &lt;BR /&gt;
can someone help me complete   *&lt;/EM&gt;| rex field=source ".."**&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Simon Mandy&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:53:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-regex-to-extract-first-folder-name-from-the-path/m-p/287508#M87042</guid>
      <dc:creator>sim_tcr</dc:creator>
      <dc:date>2020-09-29T09:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: rex regex to extract first folder name from the path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-regex-to-extract-first-folder-name-from-the-path/m-p/287509#M87043</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=source "^/(?&amp;lt;first_folder&amp;gt;[^/]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jun 2016 09:09:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-regex-to-extract-first-folder-name-from-the-path/m-p/287509#M87043</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-06-07T09:09:13Z</dc:date>
    </item>
  </channel>
</rss>

