<?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 How to extract a string without using rex or erex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-without-using-rex-or-erex/m-p/213889#M62726</link>
    <description>&lt;P&gt;How to extract a string without using rex or erex?&lt;/P&gt;

&lt;P&gt;Ex: I don't have clear logs for phone numbers, want to extract the phone number and then extract the country code from that field.&lt;/P&gt;

&lt;P&gt;I'm able to extract the phone numbers. But not able to extract the country code, since i have phone numbers with 2 and 3 digit country codes.&lt;/P&gt;

&lt;P&gt;Phone:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;%2SV334789873956
%2SV3528658298570
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Extracted Contact:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;334789873956
3528658298570
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to extract the first digits of above phone number. Here first number country code is 2 digits and second phone number has 3 digit country code.&lt;/P&gt;

&lt;P&gt;I need Country codes like below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;33
352
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please suggest something on the above without using regex&lt;/P&gt;</description>
    <pubDate>Mon, 07 Nov 2016 20:33:20 GMT</pubDate>
    <dc:creator>greeshmak</dc:creator>
    <dc:date>2016-11-07T20:33:20Z</dc:date>
    <item>
      <title>How to extract a string without using rex or erex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-without-using-rex-or-erex/m-p/213889#M62726</link>
      <description>&lt;P&gt;How to extract a string without using rex or erex?&lt;/P&gt;

&lt;P&gt;Ex: I don't have clear logs for phone numbers, want to extract the phone number and then extract the country code from that field.&lt;/P&gt;

&lt;P&gt;I'm able to extract the phone numbers. But not able to extract the country code, since i have phone numbers with 2 and 3 digit country codes.&lt;/P&gt;

&lt;P&gt;Phone:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;%2SV334789873956
%2SV3528658298570
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Extracted Contact:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;334789873956
3528658298570
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to extract the first digits of above phone number. Here first number country code is 2 digits and second phone number has 3 digit country code.&lt;/P&gt;

&lt;P&gt;I need Country codes like below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;33
352
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please suggest something on the above without using regex&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2016 20:33:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-without-using-rex-or-erex/m-p/213889#M62726</guid>
      <dc:creator>greeshmak</dc:creator>
      <dc:date>2016-11-07T20:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string without using rex or erex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-without-using-rex-or-erex/m-p/213890#M62727</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval cc=substr(pn,1,len(pn)-10) | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Nov 2016 22:05:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-without-using-rex-or-erex/m-p/213890#M62727</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-11-07T22:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string without using rex or erex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-without-using-rex-or-erex/m-p/213891#M62728</link>
      <description>&lt;P&gt;@greeshmak - Did rich's answer below help you out? If yes, please don't forget to click "Accept" below his answer to resolve the question. If not, please leave a comment. Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 23:39:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-without-using-rex-or-erex/m-p/213891#M62728</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2016-11-28T23:39:33Z</dc:date>
    </item>
  </channel>
</rss>

