<?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 get query to extract phone numbers from an event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-query-to-extract-phone-numbers-from-an-event/m-p/614585#M213588</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I'm trying to get a list of phone numbers for each event by sessionId. I can't quite figure it out. I think I need to use some sort of rex command. Here's what I have so far.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=convo (input_type=VOICE OR input_type=SPEECH) botId=123456789 customerANI
| rex field=phone "\+1(?&amp;lt;phone_number&amp;gt;\d{10})"
| stats values(phone) as PhoneNumber by sessionId&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example event:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;2022-09-26T06:18:41,105+0000 [INFO ] level=INFO  [https-jssa-exec-10]-[tid=be75a0f9-9039-41ea-8104-afe25cfa7177 authId=123456789 sessionId=10987654321 test=false botId=123456789 cfBotId=123456789  offl_TKT=true proto=V2 platform=WEB input_type=SPEECH appId=web.intlgntsys.cui.sbgiva sku= pn= cid=123456789123456789 convo=service_routing_info_call]-[ServiceClient]-[55  ] ExecutingRequest requestState=executing action=contact_channels input={"appName":"voice_bot","language":"en","locale":"en-us","query":"talk with an agent","inputs":{"customerQuestion":"a wrong charge","DNIS":"+18008008000","Level":"|","Year":"2019","universalId":"123456789","Rating":"|","edition":"Blue|Yellow|Green","experience":"phone","sku":"0","intent":"BILLING","platform":"web","customerANI":"+15555555555"}}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Sep 2022 19:27:40 GMT</pubDate>
    <dc:creator>KyleMcDougall</dc:creator>
    <dc:date>2022-09-26T19:27:40Z</dc:date>
    <item>
      <title>How to get query to extract phone numbers from an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-query-to-extract-phone-numbers-from-an-event/m-p/614585#M213588</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I'm trying to get a list of phone numbers for each event by sessionId. I can't quite figure it out. I think I need to use some sort of rex command. Here's what I have so far.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=convo (input_type=VOICE OR input_type=SPEECH) botId=123456789 customerANI
| rex field=phone "\+1(?&amp;lt;phone_number&amp;gt;\d{10})"
| stats values(phone) as PhoneNumber by sessionId&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example event:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;2022-09-26T06:18:41,105+0000 [INFO ] level=INFO  [https-jssa-exec-10]-[tid=be75a0f9-9039-41ea-8104-afe25cfa7177 authId=123456789 sessionId=10987654321 test=false botId=123456789 cfBotId=123456789  offl_TKT=true proto=V2 platform=WEB input_type=SPEECH appId=web.intlgntsys.cui.sbgiva sku= pn= cid=123456789123456789 convo=service_routing_info_call]-[ServiceClient]-[55  ] ExecutingRequest requestState=executing action=contact_channels input={"appName":"voice_bot","language":"en","locale":"en-us","query":"talk with an agent","inputs":{"customerQuestion":"a wrong charge","DNIS":"+18008008000","Level":"|","Year":"2019","universalId":"123456789","Rating":"|","edition":"Blue|Yellow|Green","experience":"phone","sku":"0","intent":"BILLING","platform":"web","customerANI":"+15555555555"}}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 19:27:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-query-to-extract-phone-numbers-from-an-event/m-p/614585#M213588</guid>
      <dc:creator>KyleMcDougall</dc:creator>
      <dc:date>2022-09-26T19:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a query to extract phone numbers from an event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-query-to-extract-phone-numbers-from-an-event/m-p/614587#M213589</link>
      <description>&lt;P&gt;If you are sure that the field which includes the phone number ist called "phone" then the extraction should work. Since you want a list of phone numbers though, the second part of your query should use the extracted field:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| stats values(phone_number) as PhoneNumber by sessionId&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;_______________________________________&lt;/P&gt;&lt;P&gt;If this was helpful please consider awarding Karma. Thx!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 16:05:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-query-to-extract-phone-numbers-from-an-event/m-p/614587#M213589</guid>
      <dc:creator>FelixLeh</dc:creator>
      <dc:date>2022-09-26T16:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a query to extract phone numbers from an event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-query-to-extract-phone-numbers-from-an-event/m-p/614589#M213590</link>
      <description>&lt;P&gt;The current query I have doesn't work. I just added phone_number for the sake of understanding in this thread.&lt;/P&gt;&lt;P&gt;In the event below, the phone number is listed as: 15555555555&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 16:11:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-query-to-extract-phone-numbers-from-an-event/m-p/614589#M213590</guid>
      <dc:creator>KyleMcDougall</dc:creator>
      <dc:date>2022-09-26T16:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a query to extract phone numbers from an event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-query-to-extract-phone-numbers-from-an-event/m-p/614591#M213591</link>
      <description>&lt;P&gt;If the Event Example is the _raw data of the event then this should work:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| rex field=_raw "\"customerANI\"\:\"\+1(?&amp;lt;phone_number&amp;gt;\d{10})"&lt;BR /&gt;| stats values(phone_number) as PhoneNumber by sessionId&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIT:&amp;nbsp;&lt;/STRONG&gt;for clarification,&amp;nbsp;the query from my first answer obviously would still need the extraction:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| rex field=phone "\+1(?&amp;lt;phone_number&amp;gt;\d{10})"&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG&gt;| stats values(phone_number) as PhoneNumber by sessionId&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;_______________________________________&lt;/P&gt;&lt;P&gt;If this was helpful please consider awarding Karma. Thx!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 16:53:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-query-to-extract-phone-numbers-from-an-event/m-p/614591#M213591</guid>
      <dc:creator>FelixLeh</dc:creator>
      <dc:date>2022-09-26T16:53:12Z</dc:date>
    </item>
  </channel>
</rss>

