<?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 part of path that may or may not contain space in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/extract-part-of-path-that-may-or-may-not-contain-space/m-p/441199#M125352</link>
    <description>&lt;P&gt;Hello Sarit,&lt;/P&gt;

&lt;P&gt;Kindly find the modified rex query for your reference.&lt;/P&gt;

&lt;P&gt;rex field = source  \/splunk\/\w+\/\w+\/\w+\/\w+\s+\w+\/(?\w+)&lt;/P&gt;</description>
    <pubDate>Tue, 07 May 2019 11:13:29 GMT</pubDate>
    <dc:creator>gouravdashtcs</dc:creator>
    <dc:date>2019-05-07T11:13:29Z</dc:date>
    <item>
      <title>extract part of path that may or may not contain space</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-part-of-path-that-may-or-may-not-contain-space/m-p/441196#M125349</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;i have source path that looks like :&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;s3://splunk/OTHER/1/OTHER/Star J750/pjserialnumber/2019-05-06T13:40:37.490Z_1.91.0.192_1.88.0.0_31.29.60.11592/metadata.json&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;i want to extract "pjserialnumber"&lt;BR /&gt;
but since i have space in "Star j750"&lt;BR /&gt;
my regex is not working&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=source \/splunk\/\w+\/\w+\/\w+\/(?&amp;lt;SerialNumber&amp;gt;\w+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my problem is that i want to create a macro from this regex but not all the path's contain space&lt;/P&gt;

&lt;P&gt;how can i fix both of the problems ?&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:22:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-part-of-path-that-may-or-may-not-contain-space/m-p/441196#M125349</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2020-09-30T00:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: extract part of path that may or may not contain space</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-part-of-path-that-may-or-may-not-contain-space/m-p/441197#M125350</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Give a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval msg="s3://splunk/OTHER/1/OTHER/Star J750/pjserialnumber/2019-05-06T13:40:37.490Z_1.91.0.192_1.88.0.0_31.29.60.11592/metadata.json" 
| eval SerialNumber = mvindex(split(msg,"/") ,7)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 May 2019 11:03:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-part-of-path-that-may-or-may-not-contain-space/m-p/441197#M125350</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-05-07T11:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: extract part of path that may or may not contain space</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-part-of-path-that-may-or-may-not-contain-space/m-p/441198#M125351</link>
      <description>&lt;P&gt;You can change it to something like &lt;CODE&gt;\/splunk\/\w+\/\w+\/\w+\/(?&amp;lt;SerialNumber&amp;gt;[^\/]*)\/&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/lcAZF0/3"&gt;https://regex101.com/r/lcAZF0/3&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 11:05:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-part-of-path-that-may-or-may-not-contain-space/m-p/441198#M125351</guid>
      <dc:creator>lakshman239</dc:creator>
      <dc:date>2019-05-07T11:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: extract part of path that may or may not contain space</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-part-of-path-that-may-or-may-not-contain-space/m-p/441199#M125352</link>
      <description>&lt;P&gt;Hello Sarit,&lt;/P&gt;

&lt;P&gt;Kindly find the modified rex query for your reference.&lt;/P&gt;

&lt;P&gt;rex field = source  \/splunk\/\w+\/\w+\/\w+\/\w+\s+\w+\/(?\w+)&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 11:13:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-part-of-path-that-may-or-may-not-contain-space/m-p/441199#M125352</guid>
      <dc:creator>gouravdashtcs</dc:creator>
      <dc:date>2019-05-07T11:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: extract part of path that may or may not contain space</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-part-of-path-that-may-or-may-not-contain-space/m-p/441200#M125353</link>
      <description>&lt;P&gt;this is taking the wrong part of the path&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 11:15:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-part-of-path-that-may-or-may-not-contain-space/m-p/441200#M125353</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-07T11:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: extract part of path that may or may not contain space</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-part-of-path-that-may-or-may-not-contain-space/m-p/441201#M125354</link>
      <description>&lt;P&gt;work perfect !&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 11:15:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-part-of-path-that-may-or-may-not-contain-space/m-p/441201#M125354</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-07T11:15:35Z</dc:date>
    </item>
  </channel>
</rss>

