<?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 make column from Multivalues field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302348#M90984</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;
I didn't use it in this way but probably multikv command (&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.6.2/SearchReference/Multikv"&gt;http://docs.splunk.com/Documentation/Splunk/6.6.2/SearchReference/Multikv&lt;/A&gt;) could solve your problem.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jul 2017 11:56:28 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2017-07-10T11:56:28Z</dc:date>
    <item>
      <title>how to make column from Multivalues field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302345#M90981</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Hi Splunker,

Please find below the data of 2 events below where i have to change the result in tabular form.so that i can see the muti valued field value as a field name in splunk when there are multple events

Query:-
|rex field=_raw "\&amp;lt;(?&amp;lt;Name&amp;gt;[^\&amp;gt;]+)\&amp;gt;(?&amp;lt;Value&amp;gt;[^\&amp;lt;]+)" max_match=50|table Name Value

My result in Splunk look like this these and are multivalued result in statistics bar.

**Name**                        **Value**
Customer                         Karen
SalesChannel                     Online
UniqueID                         a2wert
ProductCode                      zebra
ProductName                      Maestri
ProductCode                      zebra2
ProductName                      Maestri2
------------------------------------------------------
Customer                            Topez
SalesChannel                     Online
UniqueID                         a23ret
ProductCode                      Umbrella
ProductName                      Yousty
ProductCode                      Umbrella2
ProductName                      Yousty2
ProductCode                      Umbrella3
ProductName                      Yousty3

I want my result to look like this 

Customer      SalesChannel                UniqueID           ProductCode          ProductName                                     
Karen              Online                 a2wert             zebra                  Maestri
                                                             zebra2                 Maestri2                         
Topez              Online                 a23ret             Umbrella               Yousty 
                                                             Umbrella2              Yousty2                       
                                                             Umbrella 3             Yousty 3  
then the 3rd,4th enrty and so on...

Can you please help me on it.
Thanks in advance
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Jul 2017 10:43:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302345#M90981</guid>
      <dc:creator>m7787579</dc:creator>
      <dc:date>2017-07-10T10:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to make column from Multivalues field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302346#M90982</link>
      <description>&lt;P&gt;Hi m7787579,&lt;BR /&gt;
add at the end of your search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search
|rex field=_raw "\&amp;lt;(?&amp;lt;Name&amp;gt;[^\&amp;gt;]+)\&amp;gt;(?&amp;lt;Value&amp;gt;[^\&amp;lt;]+)" max_match=50
| stats values(SalesChannel) AS SalesChannel values(UniqueID) AS UniqueID values(ProductCode) AS ProductCode values(ProductName) AS ProductName by Customer
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Beware: the values option put in alphabetical order the found values, so if you have more than one value in two columns, the second of the first column could not be aligned with the second of the second column.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 10:52:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302346#M90982</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-10T10:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to make column from Multivalues field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302347#M90983</link>
      <description>&lt;P&gt;Hi Giuseppe,&lt;/P&gt;

&lt;P&gt;Thanks for your answer,&lt;/P&gt;

&lt;P&gt;But here only Name and Values are field.&lt;/P&gt;

&lt;P&gt;Rest of the field like Customer,SalesChannel,UniqueID,ProductCode,ProductName are just the values for Name and i want these values to become as a column name like Name and Values are column name.&lt;/P&gt;

&lt;P&gt;Please let me know if you have any doubt&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 11:02:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302347#M90983</guid>
      <dc:creator>m7787579</dc:creator>
      <dc:date>2017-07-10T11:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to make column from Multivalues field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302348#M90984</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
I didn't use it in this way but probably multikv command (&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.6.2/SearchReference/Multikv"&gt;http://docs.splunk.com/Documentation/Splunk/6.6.2/SearchReference/Multikv&lt;/A&gt;) could solve your problem.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 11:56:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302348#M90984</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-10T11:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to make column from Multivalues field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302349#M90985</link>
      <description>&lt;P&gt;Thanks Giuseppe,&lt;/P&gt;

&lt;P&gt;But it is still not helping me to get my result.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 13:09:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302349#M90985</guid>
      <dc:creator>m7787579</dc:creator>
      <dc:date>2017-07-10T13:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to make column from Multivalues field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302350#M90986</link>
      <description>&lt;P&gt;Can anyone please help me on it,i am still facing the issue and i need it to submit it as soon as possible&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 13:18:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302350#M90986</guid>
      <dc:creator>m7787579</dc:creator>
      <dc:date>2017-07-10T13:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to make column from Multivalues field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302351#M90987</link>
      <description>&lt;P&gt;try this,&lt;/P&gt;

&lt;P&gt;your base search |table Name Value | transpose&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 13:46:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302351#M90987</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2017-07-10T13:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to make column from Multivalues field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302352#M90988</link>
      <description>&lt;P&gt;Nopz it is not working &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 13:56:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302352#M90988</guid>
      <dc:creator>m7787579</dc:creator>
      <dc:date>2017-07-10T13:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to make column from Multivalues field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302353#M90989</link>
      <description>&lt;P&gt;There has to be a less clumsy way to do this, but this should work - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search
| rex field=_raw "\&amp;lt;(?&amp;lt;Name&amp;gt;[^\&amp;gt;]+)\&amp;gt;(?&amp;lt;Value&amp;gt;[^\&amp;lt;]+)" max_match=50
| streamstats count as recno
| eval NameValue=mvzip(Name,Value,"=")
| table recno NameValue
| mvexpand NameValue
| rex field=NameValue "(?&amp;lt;Name&amp;gt;[^=]+)=(?&amp;lt;Value&amp;gt;.*)"
| eval {Name}=Value
| fields - Name Value NameValue
| stats list(*) as * by recno
| fields - recno 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Jul 2017 15:16:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302353#M90989</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-10T15:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to make column from Multivalues field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302354#M90990</link>
      <description>&lt;P&gt;....... |rex field=_raw "(?&amp;amp;lteventData&amp;amp;gt\S+\s+\S+)" max_match=50  | eval test = mvjoin(eventData,"#") | rex field=test max_match=50 "Customer\s+(?P&amp;amp;ltCustomerValue&amp;amp;gt\S+)#" | rex field=test max_match=50 "SalesChannel\s+(?P&amp;amp;ltSalesChannelValue&amp;amp;gt\S+)#" |  rex field=test max_match=50 "UniqueID\s+(?P&amp;amp;ltUniqueIDValue&amp;amp;gt\S+)#" | rex field=test  max_match=50 "ProductCode\s+(?P&amp;amp;ltProductCodeValue&amp;amp;gt\S+)#" | rex field=test max_match=50 "ProductName\s+(?P&amp;amp;ltProductNameValue&amp;amp;gt\S+)#"  | stats Values(SalesChannelValue) as SalesChannel, values(UniqueIDValue) as UniqueID, values(ProductCodeValue) as ProductCode, Values(ProductNameValue) as ProductName by CustomerValue&lt;/P&gt;

&lt;P&gt;Note: Change the initial regex. Instead of Name and Value give as eventData&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:49:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302354#M90990</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2020-09-29T14:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to make column from Multivalues field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302355#M90991</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval raw="Customer=Karen,SalesChannel=Online,UniqueID=a2wert,ProductCode=zebra,ProductName=Maestri,ProductCode=zebra2,ProductName=Maestri2::Customer=Topez,SalesChannel=Online,UniqueID=a23ret,ProductCode=Umbrella,ProductName=Yousty,ProductCode=Umbrella2,ProductName=Yousty2,ProductCode=Umbrella3,ProductName=Yousty3" 
| makemv delim="::" raw
| mvexpand raw
| rename raw AS _raw
| rex max_match=100 "(?&amp;lt;name&amp;gt;[^,=]+)=(?&amp;lt;value&amp;gt;[^,]+)"

| rename COMMENT AS "Everything above is faking your data; everyting below is your solution"

| streamstats count AS _serial
| eval KVP=mvzip(name, value, "=")
| table KVP _serial
| mvexpand KVP
| rex field=KVP "^(?&amp;lt;KVP_key&amp;gt;[^=]+)=(?&amp;lt;KVP_value&amp;gt;[^=]+)$"
| eval {KVP_key}=KVP_value
| fields - KVP*
| stats values(*) AS * BY _serial
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Jul 2017 16:16:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302355#M90991</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-10T16:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to make column from Multivalues field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302356#M90992</link>
      <description>&lt;P&gt;Hi DalJeanis,&lt;/P&gt;

&lt;P&gt;Thanks for your answer it was exactly my requirement.&lt;/P&gt;

&lt;P&gt;One more question i have to ask how can i calculate these that combination count.&lt;BR /&gt;
I mean if you o back to my qustion asked above i have pasted one XML there in the last after Product Name i would like to see these combination count.&lt;/P&gt;

&lt;P&gt;I mean how many time these fields in same combination occured in my data.&lt;BR /&gt;
I want to identify the count of different combinatition.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 17:32:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302356#M90992</guid>
      <dc:creator>m7787579</dc:creator>
      <dc:date>2017-07-10T17:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to make column from Multivalues field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302357#M90993</link>
      <description>&lt;P&gt;Depends on what you mean.  If you want to see how many of each Name Value combination occur in the entire search, then right after this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table recno NameValue
| mvexpand NameValue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...you can do this instead... &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count as Count by NameValue
| rex field=NameValue "(?&amp;lt;Name&amp;gt;[^=]+)=(?&amp;lt;Value&amp;gt;.*)"
| table Name Value Count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;On the other hand, if you just want to know how many values the multivalue field has, then use &lt;CODE&gt;mvcount&lt;/CODE&gt; right after &lt;CODE&gt;stats&lt;/CODE&gt;...&lt;/P&gt;

&lt;P&gt;| eval mycount = mvcount(ProductName)&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 03:55:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302357#M90993</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-11T03:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to make column from Multivalues field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302358#M90994</link>
      <description>&lt;P&gt;Also, you can use &lt;CODE&gt;multikv&lt;/CODE&gt; for this and it should be much simpler/smaller and scale better:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Multikv"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Multikv&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2019 23:08:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-make-column-from-Multivalues-field/m-p/302358#M90994</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-09T23:08:46Z</dc:date>
    </item>
  </channel>
</rss>

