<?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 capture values with regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-capture-values-with-regex/m-p/421176#M120995</link>
    <description>&lt;P&gt;Thanks for the answer but it did not seem to work. I put a better example in a comment to my post&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jan 2019 19:55:23 GMT</pubDate>
    <dc:creator>ebkeys94</dc:creator>
    <dc:date>2019-01-22T19:55:23Z</dc:date>
    <item>
      <title>How do you capture values with regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-capture-values-with-regex/m-p/421173#M120992</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I am fairly new to regex and cannot figure out how to capture certain strings. Here is an example of the string in the file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"'phoneNumber'  '1234567890'"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This string comes on one line and the two values are separated by a tab chart. I want to extract all of these phone numbers and list them under a 'phoneNumber' column. How do I go about getting these numbers? Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 16:30:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-capture-values-with-regex/m-p/421173#M120992</guid>
      <dc:creator>ebkeys94</dc:creator>
      <dc:date>2019-01-22T16:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do you capture values with regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-capture-values-with-regex/m-p/421174#M120993</link>
      <description>&lt;P&gt;Assuming the ph number is going to be 10 digits you can use,  rex field=x "'phone number'\s+'(?\d{10})'"&lt;/P&gt;

&lt;P&gt;For example-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults |eval x="'phone number' '1234567890'"| rex field=x "'phone number'\s+'(?&amp;lt;phoneNumber&amp;gt;\d{10})'"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Jan 2019 17:51:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-capture-values-with-regex/m-p/421174#M120993</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-01-22T17:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do you capture values with regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-capture-values-with-regex/m-p/421175#M120994</link>
      <description>&lt;P&gt;I'll give a more specific example. A log can look like this: &lt;/P&gt;

&lt;P&gt;2019-01-22T19:47:46.847 Int 04543 Interaction message "EventCallDataChanged")&lt;BR /&gt;
     : message EventCallDataChanged&lt;BR /&gt;
    AttributeUserData   [2039] 00 3f 00 00..&lt;BR /&gt;
        'agent_id'  ''&lt;BR /&gt;
        'attempt'   0&lt;BR /&gt;
                'phoneNumber'    '1234567890'&lt;BR /&gt;
        'ent_CallResult'    xx&lt;BR /&gt;
        'call_time' 0&lt;BR /&gt;
        'campaign_id'   xxx&lt;/P&gt;

&lt;P&gt;I want to get all phone numbers from logs and put into phonenumber column&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:54:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-capture-values-with-regex/m-p/421175#M120994</guid>
      <dc:creator>ebkeys94</dc:creator>
      <dc:date>2020-09-29T22:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do you capture values with regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-capture-values-with-regex/m-p/421176#M120995</link>
      <description>&lt;P&gt;Thanks for the answer but it did not seem to work. I put a better example in a comment to my post&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 19:55:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-capture-values-with-regex/m-p/421176#M120995</guid>
      <dc:creator>ebkeys94</dc:creator>
      <dc:date>2019-01-22T19:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do you capture values with regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-capture-values-with-regex/m-p/421177#M120996</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=x "'phoneNumber'\s+'(?&amp;lt;phoneNumber&amp;gt;\d{10})'"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Jan 2019 20:12:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-capture-values-with-regex/m-p/421177#M120996</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-01-22T20:12:27Z</dc:date>
    </item>
  </channel>
</rss>

