<?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: What regular expression can be used to extract literals between slashes? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244962#M72983</link>
    <description>&lt;P&gt;Now I see what you are looking for. Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\/(?:[^\/\s]*\/){4}(?&amp;lt;iaComponent&amp;gt;[^\/]+)\/(?&amp;lt;iaProjectName&amp;gt;[^\/]+)\/(?&amp;lt;iaReleasedVersionName&amp;gt;[^\/]+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 25 Nov 2015 20:01:19 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2015-11-25T20:01:19Z</dc:date>
    <item>
      <title>What regular expression can be used to extract literals between slashes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244957#M72978</link>
      <description>&lt;P&gt;Ex: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/nfs/tibcosoftware/splunk/impactAnalysis/freight/ConwayServicesOMSEvents/1.01-49/AESchemas
/nfs/tibcosoftware/splunk/impactAnalysis/freight/Conway-OMSEvents/1.01-SNAPSHOT-57/AESchemas

iaComponent=freight
iaProjectName= ConwayServicesOMSEvents or Conway-OMSEvents                       
iaReleasedVersionName= 1.01-49 or 1.01-SNAPSHOT-57
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tried the following, but I cannot get &amp;lt;Project&amp;gt; literals with &lt;CODE&gt;-&lt;/CODE&gt; or &amp;lt;Version&amp;gt; literals with no SNAPSHOTS.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=eicoe_tibco_ia sourcetype=eicoe_tibco_ia "wsdl"  | rex field=iaSource "(/\w*)+(/\w*)+(/\w*)+(/\w*)+(?&amp;lt;iaComponent&amp;gt;(/\w*))+(?&amp;lt;iaProjectName&amp;gt;(/\w*))+(?&amp;lt;iaReleasedVersionName&amp;gt;(/\d*)\.(\d*)[^-]*(-SNAPSHOT))" | dedup iaComponent, iaProjectName, iaReleasedVersionName | table iaComponent, iaProjectName, iaReleasedVersionName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please advise?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2015 21:25:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244957#M72978</guid>
      <dc:creator>raghunand</dc:creator>
      <dc:date>2015-11-24T21:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: What regular expression can be used to extract literals between slashes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244958#M72979</link>
      <description>&lt;P&gt;Not sure if your Projectname has both always or you have it here just as an example of possible names. If it is just an example, you can exclude the rex for pname1&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ProjectName=\s(?&amp;lt;pname&amp;gt;[\w-]+)\sor\s(?&amp;lt;pname1&amp;gt;[\w-]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Not sure I understand you comment about no SNAPSHOTS. But here's something for you to work with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;VersionName=\s(?&amp;lt;pname&amp;gt;[\d\.-]+)\sor\s(?&amp;lt;pname1&amp;gt;[\d\.]+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Nov 2015 22:33:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244958#M72979</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-11-24T22:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: What regular expression can be used to extract literals between slashes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244959#M72980</link>
      <description>&lt;P&gt;Try this regex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\/(?:[^\/]*\/){4}(?P&amp;lt;iaComponent&amp;gt;[^\/]+)\/(?P&amp;lt;iaProjectName&amp;gt;[^\/]+)\/(?P&amp;lt;iaReleasedVersionName&amp;gt;[^\/]+)\/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Nov 2015 18:57:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244959#M72980</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-11-25T18:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: What regular expression can be used to extract literals between slashes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244960#M72981</link>
      <description>&lt;P&gt;Thank you Rich - I did get most of the desired results all versions except for versions with SNAPSHOT. Any idea how to include the SNAPSHOTS? &lt;BR /&gt;
I am adding a few example paths here:&lt;BR /&gt;
    /nfs/tibcosoftware/Splunk/impactAnalysis/menlo/FSIValidationForClassic/1.02-SNAPSHOT-1.02-SNAPSHOT.24&lt;BR /&gt;
    /nfs/tibcosoftware/Splunk/impactAnalysis/sharedapps/CSCHRCompanyEventPublisher/1.0.0-8&lt;BR /&gt;
    /nfs/tibcosoftware/Splunk/impactAnalysis/freight/ConwayServices-Customer/1.04-SNAPSHOT-47 &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=eicoe_tibco_ia sourcetype=eicoe_tibco_ia "wsdl"  | rex field=iaSource "\/(?:[^\/]*\/){4}(?P[^\/]+)\/(?P[^\/]+)\/(?P[\d\.\-]+)(?:\/|-SNAPSHOT)" | dedup iaComponent, iaProjectName, iaReleasedVersionName | table iaComponent, iaProjectName, iaReleasedVersionName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Nov 2015 19:43:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244960#M72981</guid>
      <dc:creator>raghunand</dc:creator>
      <dc:date>2015-11-25T19:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: What regular expression can be used to extract literals between slashes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244961#M72982</link>
      <description>&lt;P&gt;Thank you sundar. But I could not get any results.. maybe the search command is wrong... Here is what I tried &lt;/P&gt;

&lt;P&gt;index=eicoe_tibco_ia sourcetype=eicoe_tibco_ia "wsdl"  | rex field=iaSource "\s(?[\d.-]+)\sor\s(?[\d.]+)" | dedup pname, pname1 | table pname, pname1&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:59:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244961#M72982</guid>
      <dc:creator>raghunand</dc:creator>
      <dc:date>2020-09-29T07:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: What regular expression can be used to extract literals between slashes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244962#M72983</link>
      <description>&lt;P&gt;Now I see what you are looking for. Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\/(?:[^\/\s]*\/){4}(?&amp;lt;iaComponent&amp;gt;[^\/]+)\/(?&amp;lt;iaProjectName&amp;gt;[^\/]+)\/(?&amp;lt;iaReleasedVersionName&amp;gt;[^\/]+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Nov 2015 20:01:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244962#M72983</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-11-25T20:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: What regular expression can be used to extract literals between slashes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244963#M72984</link>
      <description>&lt;P&gt;Sorry, I thought you intended to exclude snapshots.  I've updated my answer to include them.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 20:21:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244963#M72984</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-11-25T20:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: What regular expression can be used to extract literals between slashes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244964#M72985</link>
      <description>&lt;P&gt;Sure my bad ! I see this seems to return what I want &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=eicoe_tibco_ia sourcetype=eicoe_tibco_ia "wsdl" | rex field=iaSource "\/(?:[^\/]*\/){4}(?P[^\/]+)\/(?P[^\/]+)\/(?P[^\/]+)\/" | dedup iaComponent, iaProjectName, iaReleasedVersionName | table iaComponent, iaProjectName, iaReleasedVersionName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you !! &lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 20:52:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-regular-expression-can-be-used-to-extract-literals-between/m-p/244964#M72985</guid>
      <dc:creator>raghunand</dc:creator>
      <dc:date>2015-11-25T20:52:37Z</dc:date>
    </item>
  </channel>
</rss>

