<?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: Exttract the first value  for multivalue field events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317270#M94907</link>
    <description>&lt;P&gt;Thank you for your response,how can I extract these fields into interesting fields like IFX,so that i dont need to use rex everytime&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2018 01:10:20 GMT</pubDate>
    <dc:creator>vrmandadi</dc:creator>
    <dc:date>2018-01-17T01:10:20Z</dc:date>
    <item>
      <title>Exttract the first value  for multivalue field events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317268#M94905</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;I have a sample event,which is a multivalue field,I want to extract  Service ID and Ent_Provider Id from the  type="startPlacement" .Since this is a multivalue field there are many  type="startPlacement" ,but  I want to extract the fields from the first  type="startPlacement"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;ns2:Events&amp;gt;
         &amp;lt;ns2:PlacementStatusEvent type="startPlacement" time="2018-01-16T14:16:02.238-05:00" messageRef="eeac4616-7c69-4453-a66e-01e2d8726db7"&amp;gt;
            &amp;lt;StatusCode class="0"&amp;gt;
               &amp;lt;Note&amp;gt;SUCCEEDED&amp;lt;/Note&amp;gt;
            &amp;lt;/StatusCode&amp;gt;
            &amp;lt;ns2:Spot&amp;gt;
               &amp;lt;Tracking&amp;gt;sync-ADS}:{**iCTRL Lifestyle**#**foodnetwork.com**@{b}_t_125_1516130158263321007_5a54dba8000a94c6}:{01LC5SUJUJSTa8mReTByrtGQ&amp;lt;/Tracking&amp;gt;
               &amp;lt;Content&amp;gt;
                  &amp;lt;AssetRef providerID="abc.com" assetID="DAMV8018010541107392" /&amp;gt;
                  &amp;lt;Duration&amp;gt;PT30.000S&amp;lt;/Duration&amp;gt;
                  &amp;lt;Tracking&amp;gt;tron-ADS}:{iCTRL Lifestyle#foodnetwork.com@{b}_t_125_1516130158263321007_5a54dba8000a94c6}:{01Uat1fEFCQKaxZmV1Cx72ig&amp;lt;/Tracking&amp;gt;
               &amp;lt;/Content&amp;gt;
               &amp;lt;ns2:SpotNPT scale="1"&amp;gt;0.0&amp;lt;/ns2:SpotNPT&amp;gt;
            &amp;lt;/ns2:Spot&amp;gt;
         &amp;lt;/ns2:PlacementStatusEvent&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Service_ID=iCTRL Lifestyle&lt;BR /&gt;
Ent_Provider Id=foodnetwork.com&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:43:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317268#M94905</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2020-09-29T17:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Exttract the first value  for multivalue field events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317269#M94906</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;how about using the following splunk command:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| rex max_match=1 field=&amp;lt;nameofyourmultivaluefield&amp;gt; "\&amp;lt;Tracking\&amp;gt;[^{]+\{(?&amp;lt;Service_ID&amp;gt;[^#]+)\#(?&amp;lt;Ent_Provider&amp;gt;[^@]+)"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;P.S. max_match is by default set to 1, so that wouldn't be needed and is only here for better illustration&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 22:11:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317269#M94906</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2018-01-16T22:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Exttract the first value  for multivalue field events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317270#M94907</link>
      <description>&lt;P&gt;Thank you for your response,how can I extract these fields into interesting fields like IFX,so that i dont need to use rex everytime&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 01:10:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317270#M94907</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2018-01-17T01:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Exttract the first value  for multivalue field events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317271#M94908</link>
      <description>&lt;P&gt;hey @vrmandadi&lt;/P&gt;

&lt;P&gt;try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;your_index&amp;gt; | rex field=_raw "&amp;lt;Tracking&amp;gt;sync-ADS}:{\*\*(?&amp;lt;Service_ID&amp;gt;[^\*]+)\*\*#\*\*(?&amp;lt;Ent_Provider_Id&amp;gt;[^\*]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now if you do not want to use this regex in search query and you want to extract this fields directly then do this&lt;BR /&gt;
&lt;STRONG&gt;step1&lt;/STRONG&gt; :go to &lt;CODE&gt;Fields » Field extractions » Add new&lt;/CODE&gt;&lt;BR /&gt;
&lt;STRONG&gt;step2&lt;/STRONG&gt; : fill in the details Name: &lt;CODE&gt;Service_and_provider_ID&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;
apply to sourcetype: &lt;CODE&gt;&amp;lt;put_your_sourcetype_on_which_you_want_toapply_this_regex&amp;gt;&lt;/CODE&gt;&lt;BR /&gt;
Extraction/Transform : &lt;CODE&gt;&amp;lt;Tracking&amp;gt;sync-ADS}:{\*\*(?&amp;lt;Service_ID&amp;gt;[^\*]+)\*\*#\*\*(?&amp;lt;Ent_Provider_Id&amp;gt;[^\*]+)&lt;/CODE&gt;&lt;BR /&gt;
&lt;STRONG&gt;step3&lt;/STRONG&gt; : save&lt;/P&gt;

&lt;P&gt;Then see extracted fields by entering &lt;CODE&gt;index=&amp;lt;your_index&amp;gt;&lt;/CODE&gt; on your search bar&lt;/P&gt;

&lt;P&gt;let me know if this helps !&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 07:58:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317271#M94908</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-17T07:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Exttract the first value  for multivalue field events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317272#M94909</link>
      <description>&lt;P&gt;Hello @mayurr98&lt;/P&gt;

&lt;P&gt;Thanks for the reply,I tried your rex in search ,I did not see the fields extracted.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 13:36:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317272#M94909</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2018-01-17T13:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Exttract the first value  for multivalue field events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317273#M94910</link>
      <description>&lt;P&gt;hey sorry you need to escape special characters as well&lt;BR /&gt;
try this instead&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;your_index&amp;gt; | rex field=_raw "\&amp;lt;Tracking\&amp;gt;sync\-ADS\}\:\{\*\*(?&amp;lt;Service_ID&amp;gt;[^\*]+)\*\*\#\*\*(?&amp;lt;Ent_Provider_Id&amp;gt;[^\*]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps !&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 13:40:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317273#M94910</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-17T13:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Exttract the first value  for multivalue field events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317274#M94911</link>
      <description>&lt;P&gt;Hi vrmandadi,&lt;BR /&gt;
sadly I don't know what you mean by "IFX" or "interesting fields". Could you give me an example for that?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2018 14:43:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exttract-the-first-value-for-multivalue-field-events/m-p/317274#M94911</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2018-01-22T14:43:41Z</dc:date>
    </item>
  </channel>
</rss>

