<?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 you get events where the phone number field only begins with specific digits? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417164#M120064</link>
    <description>&lt;P&gt;| means OR. If it works, please accept the answer.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Feb 2019 15:43:03 GMT</pubDate>
    <dc:creator>vnravikumar</dc:creator>
    <dc:date>2019-02-28T15:43:03Z</dc:date>
    <item>
      <title>How do you get events where the phone number field only begins with specific digits?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417159#M120059</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;

&lt;P&gt;How can I get events on a numeric field where a 7 digit number begins with 11?&lt;/P&gt;

&lt;P&gt;I tried with ...my search... field=="11*" but it is not matching all the numbers.&lt;/P&gt;

&lt;P&gt;Sample data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1166538
1212345
1116934
3331234
6037211,1166000
6037233,6031111
4160309,1118905
7031671,1117162
1186934,7038716
8016102,1187282
1176438,5254111,8925627
1175538,5254112,8925629
5254146,1178001,8925478,8925755
5254125,5268008,8925492,8925785
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Events expected to be included containing - any 7-digit-number that begins with 11XXXXX:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1166538
1116934
6037211,1166000
4160309,1118905
7031671,1117162
1186934,7038716
8016102,1187282
1176438,5254111,8925627
5254146,1178001,8925478,8925755
5254125,1168008,8925491,8925755
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 10:09:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417159#M120059</guid>
      <dc:creator>alc2019</dc:creator>
      <dc:date>2019-02-28T10:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get events where the phone number field only begins with specific digits?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417160#M120060</link>
      <description>&lt;P&gt;Hi alc2019,&lt;/P&gt;

&lt;P&gt;You can use regular expression in your search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | regex fieldname="11\d{5}"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Feb 2019 14:25:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417160#M120060</guid>
      <dc:creator>n0str0m08</dc:creator>
      <dc:date>2019-02-28T14:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get events where the phone number field only begins with specific digits?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417161#M120061</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You can try that:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Base search
| eval match = case(match(yourField,"^11\d{5}|,11\d{5}"),"YES",1=1,"NO")
| where match = "YES"
| fields - match
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if it works&lt;/P&gt;

&lt;P&gt;Kail&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 14:38:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417161#M120061</guid>
      <dc:creator>KailA</dc:creator>
      <dc:date>2019-02-28T14:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get events where the phone number field only begins with specific digits?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417162#M120062</link>
      <description>&lt;P&gt;Hi @alc2019&lt;/P&gt;

&lt;P&gt;Try this and let me know&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval sample_data ="7031671,1117162" 
| regex sample_data = "(^11\d{5}|,11\d{5})"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Feb 2019 15:01:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417162#M120062</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-02-28T15:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get events where the phone number field only begins with specific digits?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417163#M120063</link>
      <description>&lt;P&gt;Thank you!   What does the "|" mean?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 15:40:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417163#M120063</guid>
      <dc:creator>alc2019</dc:creator>
      <dc:date>2019-02-28T15:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get events where the phone number field only begins with specific digits?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417164#M120064</link>
      <description>&lt;P&gt;| means OR. If it works, please accept the answer.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 15:43:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417164#M120064</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-02-28T15:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do you get events where the phone number field only begins with specific digits?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417165#M120065</link>
      <description>&lt;P&gt;Perfect!  It works.  Thank you very much.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 00:20:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-get-events-where-the-phone-number-field-only-begins/m-p/417165#M120065</guid>
      <dc:creator>alc2019</dc:creator>
      <dc:date>2019-03-01T00:20:16Z</dc:date>
    </item>
  </channel>
</rss>

