<?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 Do I Extract The End of String in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Extract-The-End-of-String/m-p/287734#M87087</link>
    <description>&lt;P&gt;Something like this should do the trick (not tested):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "\/(?&amp;lt;mynumber&amp;gt;\d+)$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If the number is not the last part of your string then I can provide something different. &lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2016 07:15:07 GMT</pubDate>
    <dc:creator>javiergn</dc:creator>
    <dc:date>2016-04-12T07:15:07Z</dc:date>
    <item>
      <title>How Do I Extract The End of String</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Extract-The-End-of-String/m-p/287733#M87086</link>
      <description>&lt;P&gt;Hi, I wonder whether someone may be able to help me please.&lt;/P&gt;

&lt;P&gt;From a field called 'detail.input' there are two potential outputs as shown below:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Request to /for/submissions/1234567890&lt;/STRONG&gt;  and &lt;STRONG&gt;Request to /for/savedforlater/9876543210&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;What I'd like to do is extract the number at the end of the string.&lt;/P&gt;

&lt;P&gt;I'd thought about using a regex, but because of the difference in the string, i.e. "submissions" as opposed to "savedforlater", I wasn't sure whether this could be done, so I wondered if I could the 'str' and 'len' commands.&lt;/P&gt;

&lt;P&gt;I know how to omit the end of the character string, but I was wondering whether someone may be able to provide some guidance please how I can extract the end of the character string.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 06:59:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Extract-The-End-of-String/m-p/287733#M87086</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2016-04-12T06:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Extract The End of String</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Extract-The-End-of-String/m-p/287734#M87087</link>
      <description>&lt;P&gt;Something like this should do the trick (not tested):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "\/(?&amp;lt;mynumber&amp;gt;\d+)$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If the number is not the last part of your string then I can provide something different. &lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 07:15:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Extract-The-End-of-String/m-p/287734#M87087</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-04-12T07:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Extract The End of String</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Extract-The-End-of-String/m-p/287735#M87088</link>
      <description>&lt;P&gt;Hi @javiergn, thank you for taking the time to reply to my post.&lt;/P&gt;

&lt;P&gt;The solution  works great, but so that I can improve my understanding, could you perhaps explain what the rex is doing?&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 07:37:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Extract-The-End-of-String/m-p/287735#M87088</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2016-04-12T07:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Extract The End of String</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Extract-The-End-of-String/m-p/287736#M87089</link>
      <description>&lt;P&gt;Check out the explanation here: &lt;A href="https://regex101.com/r/eY4cN2/1"&gt;https://regex101.com/r/eY4cN2/1&lt;/A&gt; (tab on the right hand side)&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 08:07:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Extract-The-End-of-String/m-p/287736#M87089</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2016-04-12T08:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Extract The End of String</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Extract-The-End-of-String/m-p/287737#M87090</link>
      <description>&lt;P&gt;Ah, thanks for that @ziegfried.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 08:09:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Do-I-Extract-The-End-of-String/m-p/287737#M87090</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2016-04-12T08:09:08Z</dc:date>
    </item>
  </channel>
</rss>

