<?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 Extract Last 12 Characters in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-Last-12-Characters/m-p/297955#M89873</link>
    <description>&lt;P&gt;Hi, I wonder whether someone could help me please.&lt;/P&gt;

&lt;P&gt;I have the following string, which I'm trying to extract the last 12 characters i.e. A1B-CDEFB-NOT&lt;/P&gt;

&lt;P&gt;claim-a-token|N5Y-UWLB-NOT&lt;/P&gt;

&lt;P&gt;I've tried using the following regex /|(?[^\s]+) but unfortunately it extracts the whole string and not just the last 12 characters, and I'm a little unclear why.&lt;/P&gt;

&lt;P&gt;Could someone perhaps look at this please and offer some guidance on where I've gone wrong.&lt;/P&gt;

&lt;P&gt;Many thanks&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Wed, 17 May 2017 11:47:22 GMT</pubDate>
    <dc:creator>IRHM73</dc:creator>
    <dc:date>2017-05-17T11:47:22Z</dc:date>
    <item>
      <title>Extract Last 12 Characters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Last-12-Characters/m-p/297955#M89873</link>
      <description>&lt;P&gt;Hi, I wonder whether someone could help me please.&lt;/P&gt;

&lt;P&gt;I have the following string, which I'm trying to extract the last 12 characters i.e. A1B-CDEFB-NOT&lt;/P&gt;

&lt;P&gt;claim-a-token|N5Y-UWLB-NOT&lt;/P&gt;

&lt;P&gt;I've tried using the following regex /|(?[^\s]+) but unfortunately it extracts the whole string and not just the last 12 characters, and I'm a little unclear why.&lt;/P&gt;

&lt;P&gt;Could someone perhaps look at this please and offer some guidance on where I've gone wrong.&lt;/P&gt;

&lt;P&gt;Many thanks&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 11:47:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Last-12-Characters/m-p/297955#M89873</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2017-05-17T11:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Last 12 Characters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Last-12-Characters/m-p/297956#M89874</link>
      <description>&lt;P&gt;Hi IRHM73,&lt;BR /&gt;
if you haven't spaces in your string, this is your regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;field&amp;gt;[^ ]{12})$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if instead you have spaces in your string, you could use this regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;field&amp;gt;.{12})$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 11:56:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Last-12-Characters/m-p/297956#M89874</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-05-17T11:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Last 12 Characters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Last-12-Characters/m-p/297957#M89875</link>
      <description>&lt;P&gt;Hi @cusello, thank you very much for this, it works great.&lt;/P&gt;

&lt;P&gt;Many thanks and kind regards&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 11:59:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Last-12-Characters/m-p/297957#M89875</guid>
      <dc:creator>IRHM73</dc:creator>
      <dc:date>2017-05-17T11:59:17Z</dc:date>
    </item>
  </channel>
</rss>

