<?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 to extract three separate values from my sample event into a single field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-three-separate-values-from-my-sample-event-into-a/m-p/277676#M83745</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "Code.{3}(?&amp;lt;ac&amp;gt;\d{3})".*\b(?&amp;lt;pre&amp;gt;\d{3})\b.*\b(?&amp;lt;no&amp;gt;\d{4})" | eval phone=ac."-".pre."-".no
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 09 Feb 2016 21:12:26 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-02-09T21:12:26Z</dc:date>
    <item>
      <title>How to extract three separate values from my sample event into a single field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-three-separate-values-from-my-sample-event-into-a/m-p/277674#M83743</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have events with the below format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"phone":{"areaCode":"732","prefix":"986","lineNumber":"0245",
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a way we could extract all the above values to a single field called phone as 732-986-0245?&lt;/P&gt;

&lt;P&gt;Can someone please help us in this?&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Sarath&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 20:55:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-three-separate-values-from-my-sample-event-into-a/m-p/277674#M83743</guid>
      <dc:creator>splunker9999</dc:creator>
      <dc:date>2016-02-09T20:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract three separate values from my sample event into a single field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-three-separate-values-from-my-sample-event-into-a/m-p/277675#M83744</link>
      <description>&lt;P&gt;Correcting my question !!&lt;/P&gt;

&lt;P&gt;we actually have the value as below in our events and we need to extract from events &lt;BR /&gt;
Hi,&lt;/P&gt;

&lt;P&gt;I have a event  with below format&lt;/P&gt;

&lt;P&gt;"phone":{"areaCode":"732","prefix":"986","lineNumber":"0245",&lt;/P&gt;

&lt;P&gt;Is there a way, we could extract all the above to a single field called phone as 732-986-0245?&lt;/P&gt;

&lt;P&gt;Can someone please help us in this?&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Sarath&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 20:58:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-three-separate-values-from-my-sample-event-into-a/m-p/277675#M83744</guid>
      <dc:creator>splunker9999</dc:creator>
      <dc:date>2016-02-09T20:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract three separate values from my sample event into a single field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-three-separate-values-from-my-sample-event-into-a/m-p/277676#M83745</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "Code.{3}(?&amp;lt;ac&amp;gt;\d{3})".*\b(?&amp;lt;pre&amp;gt;\d{3})\b.*\b(?&amp;lt;no&amp;gt;\d{4})" | eval phone=ac."-".pre."-".no
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Feb 2016 21:12:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-three-separate-values-from-my-sample-event-into-a/m-p/277676#M83745</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-02-09T21:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract three separate values from my sample event into a single field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-three-separate-values-from-my-sample-event-into-a/m-p/277677#M83746</link>
      <description>&lt;P&gt;Do you have json formatted events and right now you get 3 fields &lt;CODE&gt;phone.areaCode&lt;/CODE&gt;, &lt;CODE&gt;phone.prefix&lt;/CODE&gt; and &lt;CODE&gt;phone.lineNumber&lt;/CODE&gt; OR you just get a field say phone and that field contains the whole string &lt;CODE&gt;"phone":{"areaCode":"732","prefix":"986","lineNumber":"0245"&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 21:18:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-three-separate-values-from-my-sample-event-into-a/m-p/277677#M83746</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-09T21:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract three separate values from my sample event into a single field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-three-separate-values-from-my-sample-event-into-a/m-p/277678#M83747</link>
      <description>&lt;P&gt;Just create a calculated field for the sourcetype (under Settings-&amp;gt;Fields) and use the eval expression &lt;CODE&gt;phone.areaCode."-".phone.prefix."-".phone.lineNumber&lt;/CODE&gt;&lt;BR /&gt;
Make sure you elevate to app or system visibility and the field will show up whenever you search for that sourcetype.&lt;BR /&gt;
This, of course, assumes that you have valid JSON events and not just the fragment you have shown us...&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 22:16:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-three-separate-values-from-my-sample-event-into-a/m-p/277678#M83747</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2016-02-09T22:16:36Z</dc:date>
    </item>
  </channel>
</rss>

