<?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 Extract Fields and Values on a multivalue field in search time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343448#M101718</link>
    <description>&lt;P&gt;why you didn't accept answer if it works?&lt;/P&gt;</description>
    <pubDate>Fri, 12 Apr 2019 06:35:14 GMT</pubDate>
    <dc:creator>askhat_pernebek</dc:creator>
    <dc:date>2019-04-12T06:35:14Z</dc:date>
    <item>
      <title>How Extract Fields and Values on a multivalue field in search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343436#M101706</link>
      <description>&lt;P&gt;I want to extract the fields and values  from the following event:&lt;/P&gt;

&lt;P&gt;1997-11-14 12:11:56 schedule ERROR a.b.c.d.e SomeProcess::ERROR::Alert::FAILURE::{"NAME=FAILURE":[["Name=somename","p_name=abcd","type=F","status=B"],["Name=somename1","p_name=abcde","type=T","status=C"],&lt;BR /&gt;
["Name=somename3","p_name=abde","type=T","status=C"]]}&lt;/P&gt;

&lt;P&gt;The search results should look like:&lt;BR /&gt;
Name             p_name,  Type status &lt;BR /&gt;
somename    abcd          F        B&lt;BR /&gt;&lt;BR /&gt;
somename1  abcde        T        C&lt;BR /&gt;&lt;BR /&gt;
somename3  abde          T        C&lt;/P&gt;

&lt;P&gt;I tried with mvexpan and makemv but could get the desired result. &lt;BR /&gt;
search | rex ":[[*(?result[^}]+)" | mvexpand result | makemv delim="," result | table result&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:47:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343436#M101706</guid>
      <dc:creator>nravichandran</dc:creator>
      <dc:date>2020-09-29T13:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: How Extract Fields and Values on a multivalue field in search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343437#M101707</link>
      <description>&lt;P&gt;Does this do what you want?:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH_HERE | rex max_match=100 "Name=(?P&amp;lt;Name&amp;gt;[^\"]+)\",\"p_name=(?P&amp;lt;p_name&amp;gt;[^\"]+)\",\"type=(?P&amp;lt;type&amp;gt;\w+)\",\"status=(?P&amp;lt;status&amp;gt;\w+)\"" | eval temp=mvzip(mvzip(mvzip(Name,p_name,"#"),type,"#"),status,"#") | mvexpand temp | rex field=temp "(?&amp;lt;Name&amp;gt;.+)#(?&amp;lt;p_name&amp;gt;.+)#(?&amp;lt;type&amp;gt;.+)#(?&amp;lt;status&amp;gt;.+)" | table Name, p_name, type, status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Apr 2017 22:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343437#M101707</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-04-21T22:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: How Extract Fields and Values on a multivalue field in search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343438#M101708</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your Base Search Here
| rex max_match=0 "\"(?&amp;lt;kvp&amp;gt;[^=\"]+=[^=\"]+)\""
| table _time host kvp*
| streamstats count AS serial
| mvexpand kvp
| rex field=kvp "^(?&amp;lt;kvp_key&amp;gt;[^=\"]+)=(?&amp;lt;kvp_value&amp;gt;[^=\"]+)$"
| eval {kvp_key} = kvp_value
| rename COMMENT AS "If you need to reconstitute original events, then add in the next line"
| rename COMMENT AS "| fields - kvp* | stats values(_time) AS _time values(*) AS * BY serial"
| table Name p_name Type status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note that this is a generic approach that works for all KVPs.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 23:01:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343438#M101708</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-04-21T23:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: How Extract Fields and Values on a multivalue field in search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343439#M101709</link>
      <description>&lt;P&gt;great approach&lt;/P&gt;</description>
      <pubDate>Sat, 22 Apr 2017 09:07:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343439#M101709</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2017-04-22T09:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: How Extract Fields and Values on a multivalue field in search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343440#M101710</link>
      <description>&lt;P&gt;When i run the following query i get the results but the last row get truncated. The values for status and type for the last row is not shown.&lt;/P&gt;

&lt;P&gt;| rex max_match=0 "\"(?[^=\"]+=[^=\"]+)\"" &lt;BR /&gt;
| table _time host kvp* | streamstats count AS serial &lt;BR /&gt;
| mvexpand kvp | rex field=kvp "^(?[^=\"]+)=(?[^=\"]+)$" &lt;BR /&gt;
| eval {kvp_key} = kvp_value &lt;BR /&gt;
| fields - kvp* | stats values(_time) AS _time values(*) AS * BY serial&lt;/P&gt;

&lt;P&gt;Result:&lt;/P&gt;

&lt;P&gt;Name            p_name status type&lt;BR /&gt;
somename   abcd        B         F&lt;BR /&gt;
somename1 abcde      C         T&lt;BR /&gt;
somename3  abde&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:47:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343440#M101710</guid>
      <dc:creator>nravichandran</dc:creator>
      <dc:date>2020-09-29T13:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: How Extract Fields and Values on a multivalue field in search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343441#M101711</link>
      <description>&lt;P&gt;When I changed the stats values to stats list it works!&lt;BR /&gt;
The values shows the unique and list shows all.&lt;/P&gt;

&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2017 00:43:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343441#M101711</guid>
      <dc:creator>nravichandran</dc:creator>
      <dc:date>2017-04-23T00:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: How Extract Fields and Values on a multivalue field in search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343442#M101712</link>
      <description>&lt;P&gt;This  works for my requirement. Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2017 00:57:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343442#M101712</guid>
      <dc:creator>nravichandran</dc:creator>
      <dc:date>2017-04-23T00:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: How Extract Fields and Values on a multivalue field in search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343443#M101713</link>
      <description>&lt;P&gt;Why &lt;CODE&gt;"\"(?&amp;lt;kvp&amp;gt;[^=\"]+=[^=\"]+)\""&lt;/CODE&gt; and not just &lt;CODE&gt;"\"(?&amp;lt;kvp&amp;gt;[^\"]+)\""&lt;/CODE&gt;&lt;BR /&gt;
Also here:  &lt;CODE&gt;"^(?&amp;lt;kvp_key&amp;gt;[^=\"]+)=(?&amp;lt;kvp_value&amp;gt;[^=\"]+)$"&lt;/CODE&gt; you do not need the &lt;CODE&gt;"&lt;/CODE&gt; since its already removed, so this should do: &lt;CODE&gt;"^(?&amp;lt;kvp_key&amp;gt;[^=]+)=(?&amp;lt;kvp_value&amp;gt;.+)$"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2017 10:20:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343443#M101713</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2017-04-23T10:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: How Extract Fields and Values on a multivalue field in search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343444#M101714</link>
      <description>&lt;P&gt;Because these answers evolve as I write them and I do not always do a final cleanup once it works but you are correct on both points.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2017 13:30:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343444#M101714</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-04-23T13:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: How Extract Fields and Values on a multivalue field in search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343445#M101715</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;  . .  . .&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2017 14:29:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343445#M101715</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2017-04-23T14:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: How Extract Fields and Values on a multivalue field in search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343446#M101716</link>
      <description>&lt;P&gt;Sorry I have to unaccept this answer. There is a problem with this approach as the stats list(*) hits the limit. Moreover it should be a table format - whereas the stats list displaying it a one group.&lt;BR /&gt;
_time Name p_name status type&lt;BR /&gt;
xxx     xxx       xxx         xxx      xxx&lt;BR /&gt;
xxx     xxx       xxx         xxx      xxx&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:00:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343446#M101716</guid>
      <dc:creator>nravichandran</dc:creator>
      <dc:date>2020-09-29T14:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: How Extract Fields and Values on a multivalue field in search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343447#M101717</link>
      <description>&lt;P&gt;If this really works, then you should accept this answer.&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 04:42:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343447#M101717</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-12T04:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: How Extract Fields and Values on a multivalue field in search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343448#M101718</link>
      <description>&lt;P&gt;why you didn't accept answer if it works?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 06:35:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Extract-Fields-and-Values-on-a-multivalue-field-in-search/m-p/343448#M101718</guid>
      <dc:creator>askhat_pernebek</dc:creator>
      <dc:date>2019-04-12T06:35:14Z</dc:date>
    </item>
  </channel>
</rss>

