<?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: extracting country codes that has no fix length in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169179#M186224</link>
    <description>&lt;P&gt;what do we have except tel:001001323353? are those the original events from splunk? regex does find match using &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; tel:\d+
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 10 Dec 2013 05:38:22 GMT</pubDate>
    <dc:creator>linu1988</dc:creator>
    <dc:date>2013-12-10T05:38:22Z</dc:date>
    <item>
      <title>extracting country codes that has no fix length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169172#M186217</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I would just like to ask, as to how I could extract country codes within series of numerical values with no fix length? The country code is within a field with starting 001001(prefix fixed length - 6 digits) then followed by the country code but without fixed length, then lastly followed by the MIN(mobile identification number) also not fixed in length. I just need the country codes inside but I'm out of wits on how to go about it, if the country code and MIN are not fixed in length. BTW, I have a lookup table but the country code is not fixed in length in the lookup table as well and I have tried to prefix a couple of zeros in the lookup table but it is not feasible because the actual data does not have leading zeros. Here are a couple of sample data:&lt;/P&gt;

&lt;P&gt;tel:001001323353&lt;BR /&gt;&lt;BR /&gt;
tel:001001974555&lt;BR /&gt;&lt;BR /&gt;
tel:00100196659261&lt;BR /&gt;&lt;BR /&gt;
tel:001001966505998&lt;BR /&gt;&lt;BR /&gt;
tel:001001966015201&lt;BR /&gt;&lt;BR /&gt;
tel:001001338141015&lt;BR /&gt;&lt;BR /&gt;
tel:001001955009976&lt;BR /&gt;&lt;BR /&gt;
tel:001001965601621&lt;BR /&gt;&lt;BR /&gt;
tel:0010013203532&lt;BR /&gt;&lt;BR /&gt;
tel:00100163170000&lt;BR /&gt;&lt;BR /&gt;
tel:0010014647016&lt;BR /&gt;&lt;BR /&gt;
tel:00100197551559&lt;BR /&gt;&lt;BR /&gt;
tel:001001333532000&lt;BR /&gt;&lt;BR /&gt;
tel:0010013033532090&lt;BR /&gt;&lt;BR /&gt;
tel:001001323532000&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2013 06:53:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169172#M186217</guid>
      <dc:creator>adomila</dc:creator>
      <dc:date>2013-12-06T06:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: extracting country codes that has no fix length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169173#M186218</link>
      <description>&lt;P&gt;If there is no way of determining where the country code ends, you'd have to provide a list of all unique country codes that should be possible to match. Like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;001001(1|21|33|35|47|46)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and so on.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2013 06:59:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169173#M186218</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-12-06T06:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: extracting country codes that has no fix length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169174#M186219</link>
      <description>&lt;P&gt;WOW! That was fast and accurate. Thanks a bunch Ayn.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2013 07:15:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169174#M186219</guid>
      <dc:creator>adomila</dc:creator>
      <dc:date>2013-12-06T07:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: extracting country codes that has no fix length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169175#M186220</link>
      <description>&lt;P&gt;No problem. Could you please mark my answer as accepted? Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2013 07:31:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169175#M186220</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-12-06T07:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: extracting country codes that has no fix length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169176#M186221</link>
      <description>&lt;P&gt;Properly parsing arbitrary numbers to correctly determine what country code is in there, if any, is a very tricky matter.   Unless you're dealing with a small subset of country codes, and unless you're fine with a lot of false positives from things like incomplete numbers,   you can't really do it with regex. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://en.wikipedia.org/wiki/List_of_country_calling_codes"&gt;http://en.wikipedia.org/wiki/List_of_country_calling_codes&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Our most recent Splunk for Cisco CDR app packages some code licensed and ported from Android that actually parses out the numbers as well as local area codes. From this it infers geographical regions.  Within the US it also parses exchanges and gets zipcodes which it then uses to get an approximate city and state.   I've been thinking of releasing the package as its own commercial Splunk app for use with anyone who wanted just that one feature.&lt;BR /&gt;&lt;BR /&gt;
What particular call system are you using here?   It's also quite possible that Sideview could create an app for that system and package these same features for that system. &lt;/P&gt;

&lt;P&gt;btw the code we use is a python port of Android's libphonenumber&lt;BR /&gt;
( &lt;A href="http://code.google.com/p/libphonenumber/"&gt;http://code.google.com/p/libphonenumber/&lt;/A&gt; ) &lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2013 07:36:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169176#M186221</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2013-12-06T07:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: extracting country codes that has no fix length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169177#M186222</link>
      <description>&lt;P&gt;WOW! I'm a big fan of sideview as well. It would be great if you could create and app for this. With regards to your question, I'm not quite sure what call system this is but the logs are definitely CDRs. Looking forward to the app for this. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2013 07:53:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169177#M186222</guid>
      <dc:creator>adomila</dc:creator>
      <dc:date>2013-12-06T07:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: extracting country codes that has no fix length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169178#M186223</link>
      <description>&lt;P&gt;Hi Ayn,&lt;BR /&gt;
I have 845 of those values. When I tried to hardcode it, it was so slow. In fact, it has not completed/finished running as of this writing. Can you provide specific/actual scripts? Btw, I came up with this index=xxx tel:001001323 OR tel:00100197 OR tel:0010019665 and so on and so forth...&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2013 10:20:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169178#M186223</guid>
      <dc:creator>adomila</dc:creator>
      <dc:date>2013-12-06T10:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: extracting country codes that has no fix length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169179#M186224</link>
      <description>&lt;P&gt;what do we have except tel:001001323353? are those the original events from splunk? regex does find match using &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; tel:\d+
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Dec 2013 05:38:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169179#M186224</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2013-12-10T05:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: extracting country codes that has no fix length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169180#M186225</link>
      <description>&lt;P&gt;Hi Linu1988,&lt;BR /&gt;
we don't have anything except for those tel:\d+ all the country codes(w/o fixed length) including the mobile number. these are cdr log/events as mentioned by sideview. regex won't help, as mentioned also by sideview.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2013 02:07:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169180#M186225</guid>
      <dc:creator>adomila</dc:creator>
      <dc:date>2013-12-19T02:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: extracting country codes that has no fix length</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169181#M186226</link>
      <description>&lt;P&gt;There are only two good approaches to this issue:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;(&lt;STRONG&gt;Always Preferred&lt;/STRONG&gt;) Configure the logging application to separate the fields with a delimiter character.  - OR -&lt;/LI&gt;
&lt;LI&gt;Extract the country code and MIN together and then search that field for the country codes of interest.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;| regex field1="1\d+"&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2015 19:17:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extracting-country-codes-that-has-no-fix-length/m-p/169181#M186226</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2015-02-05T19:17:30Z</dc:date>
    </item>
  </channel>
</rss>

