<?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: Separate Multivalue row into multiple rows in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587499#M204602</link>
    <description>&lt;P&gt;This is the current search I am running. Replacing the .com/.net with a comma at the end then separating it on the comma&lt;/P&gt;&lt;P&gt;| inputlookup last_activity.csv&lt;BR /&gt;| eval executionTime=strftime(now(), "%Y-%m-%d %H.%M.%S")&lt;BR /&gt;| fields fqdn, ci_name_instance, first_onboarded, last_phone_home_time, executionTime&lt;BR /&gt;| where isnotnull(fqdn)&lt;BR /&gt;| replace "*.com*" WITH "*.com,*" IN ci_name_instance&lt;BR /&gt;| replace "*.net*" WITH "*.net,*" IN ci_name_instance&lt;BR /&gt;| eval ci_name_instance=split(ci_name_instance,",")&lt;BR /&gt;| mvexpand ci_name_instance&lt;BR /&gt;| replace "" WITH "NULL" IN ci_name_instance&lt;BR /&gt;| where ci_name_instance != "NULL"&lt;BR /&gt;| eval ci_name_instance = replace (ci_name_instance, "\n","")&lt;/P&gt;&lt;P&gt;Below is a search result without the row separation (blurred out for confidentiality reasons)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jpfrancetic_0-1646327917294.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18273i215F94E3759AE246/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jpfrancetic_0-1646327917294.png" alt="jpfrancetic_0-1646327917294.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2022 17:18:53 GMT</pubDate>
    <dc:creator>jpfrancetic</dc:creator>
    <dc:date>2022-03-03T17:18:53Z</dc:date>
    <item>
      <title>How to separate Multivalue row into their own multiple rows?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587483#M204594</link>
      <description>&lt;P&gt;I am trying to separate multi value rows into their own rows. I have been trying to separate by adding a comma after the end of each row and then splitting them based on the comma, but I am only able to split the first repetition of the pattern. Can anyone help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;I have rows like this:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Domain Name&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Instance name&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Last Phone home&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Search execution time&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="91px"&gt;Domain1.com&lt;/TD&gt;
&lt;TD width="25%" height="91px"&gt;instance1.com&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; instance2.com&amp;nbsp; instance3.com&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; instance4.com&lt;/TD&gt;
&lt;TD width="25%" height="91px"&gt;2022-02-28&lt;/TD&gt;
&lt;TD width="25%" height="91px"&gt;2022-03-3&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I would like to transform them into this:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Domain Name&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Instance name&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Last Phone home&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Search execution time&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;Domain1.com&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;instance1.com&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;2022-02-28&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;2022-03-02&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;Domain1.com&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;instance2.com&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;2022-02-28&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;2022-03-02&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;Domain1.com&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;instance3.com&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;2022-02-28&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;2022-03-02&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;Domain1.com&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;instance4.com&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;2022-02-28&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;2022-03-02&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 17:45:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587483#M204594</guid>
      <dc:creator>jpfrancetic</dc:creator>
      <dc:date>2022-03-03T17:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Multivalue row into multiple rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587484#M204595</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243581"&gt;@jpfrancetic&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;did you tried with mvexpand (&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Mvexpand" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Mvexpand&lt;/A&gt;)?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 16:28:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587484#M204595</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-03-03T16:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Multivalue row into multiple rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587485#M204596</link>
      <description>&lt;P&gt;I&amp;nbsp;have tried that but it isn't separating the values. This led me to try adding a comma to the end of each line in order to separate the commas. But when I do that, it only adds a comma to the first .com and misses the rest in a given row&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 16:31:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587485#M204596</guid>
      <dc:creator>jpfrancetic</dc:creator>
      <dc:date>2022-03-03T16:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Multivalue row into multiple rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587486#M204597</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243581"&gt;@jpfrancetic&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;could you share your search and a sample of your events?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 16:36:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587486#M204597</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-03-03T16:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Multivalue row into multiple rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587488#M204598</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243581"&gt;@jpfrancetic&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you tried mvexpand command?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH
| mvexpand Instance_name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample Search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="Domain_Name,Instance_name,Last_Phone_home,Search_execution_time
Domain1.com,instance1.com|instance2.com|instance3.com|instance4.com,2022-02-28,2022-03-3" | multikv forceheader=1 | eval Instance_name = split(Instance_name,"|")
| table Domain_Name,Instance_name,Last_Phone_home,Search_execution_time
|rename comment as "Upto now is for sample data only" 
| mvexpand Instance_name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-03-03 at 10.08.57 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18272iE796216433472246/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2022-03-03 at 10.08.57 PM.png" alt="Screenshot 2022-03-03 at 10.08.57 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;KV&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 16:39:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587488#M204598</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2022-03-03T16:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Multivalue row into multiple rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587499#M204602</link>
      <description>&lt;P&gt;This is the current search I am running. Replacing the .com/.net with a comma at the end then separating it on the comma&lt;/P&gt;&lt;P&gt;| inputlookup last_activity.csv&lt;BR /&gt;| eval executionTime=strftime(now(), "%Y-%m-%d %H.%M.%S")&lt;BR /&gt;| fields fqdn, ci_name_instance, first_onboarded, last_phone_home_time, executionTime&lt;BR /&gt;| where isnotnull(fqdn)&lt;BR /&gt;| replace "*.com*" WITH "*.com,*" IN ci_name_instance&lt;BR /&gt;| replace "*.net*" WITH "*.net,*" IN ci_name_instance&lt;BR /&gt;| eval ci_name_instance=split(ci_name_instance,",")&lt;BR /&gt;| mvexpand ci_name_instance&lt;BR /&gt;| replace "" WITH "NULL" IN ci_name_instance&lt;BR /&gt;| where ci_name_instance != "NULL"&lt;BR /&gt;| eval ci_name_instance = replace (ci_name_instance, "\n","")&lt;/P&gt;&lt;P&gt;Below is a search result without the row separation (blurred out for confidentiality reasons)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jpfrancetic_0-1646327917294.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18273i215F94E3759AE246/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jpfrancetic_0-1646327917294.png" alt="jpfrancetic_0-1646327917294.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 17:18:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587499#M204602</guid>
      <dc:creator>jpfrancetic</dc:creator>
      <dc:date>2022-03-03T17:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Multivalue row into multiple rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587500#M204603</link>
      <description>&lt;P&gt;mvexpand does not separate the rows when I use it. it only separates when I include something like a comma. My biggest problem with this is that it only adds a comma to the first instance. So it would end up looking like this:&lt;/P&gt;&lt;TABLE border="1" width="99.99922583376294%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Domain Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Instance name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Last Phone home&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Search execution time&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="91px"&gt;Domain1.com&lt;/TD&gt;&lt;TD width="25%" height="91px"&gt;instance1.com,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;instance2.com&amp;nbsp; instance3.com&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; instance4.com&lt;/TD&gt;&lt;TD width="25%" height="91px"&gt;2022-02-28&lt;/TD&gt;&lt;TD width="25%" height="91px"&gt;2022-03-3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and it separates into this:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Domain Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Instance name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Last Phone home&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;&lt;STRONG&gt;Search execution time&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%" height="91px"&gt;Domain1.com&lt;/TD&gt;&lt;TD width="25%" height="91px"&gt;instance1.com&amp;nbsp;&lt;/TD&gt;&lt;TD width="25%" height="91px"&gt;2022-02-28&lt;/TD&gt;&lt;TD width="25%" height="91px"&gt;2022-03-3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Domain1.com&lt;/TD&gt;&lt;TD&gt;instance2.cominstance3.cominstance4.com&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;2022-03-3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 03 Mar 2022 17:40:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587500#M204603</guid>
      <dc:creator>jpfrancetic</dc:creator>
      <dc:date>2022-03-03T17:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Separate Multivalue row into multiple rows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587609#M204633</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;just remove comma and try below search as it is.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH
| eval Instance_name = split(Instance_name,"
") 
| mvexpand Instance_name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="Domain_Name,Instance_name,Last_Phone_home,Search_execution_time
Domain1.com,,2022-02-28,2022-03-3" 
| multikv forceheader=1
| eval Instance_name = "instance1.com
instance2.com
instance3.com
instance4.com"
| table Domain_Name,Instance_name,Last_Phone_home,Search_execution_time 
| rename comment as "Upto now is for sample data only" 
| eval Instance_name = split(Instance_name,"
") 
| mvexpand Instance_name&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 04 Mar 2022 08:06:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587609#M204633</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2022-03-04T08:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to separate Multivalue row into their own multiple rows?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587665#M204660</link>
      <description>&lt;P&gt;UPDATE:&lt;/P&gt;&lt;P&gt;I have solved the problem I am facing. I was experiencing an issue with mvexpand not splitting the rows without prior manipulation. in order to work around this, I replaced all new lines in instance_name with a comma, then split on that comma, and finally expand the values.&lt;/P&gt;&lt;P&gt;| eval instance_name = replace (instance_name , "\n",",")&lt;BR /&gt;| eval instance_name =split(instance_name ,",")&lt;BR /&gt;| mvexpand instance_name&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 15:09:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-separate-Multivalue-row-into-their-own-multiple-rows/m-p/587665#M204660</guid>
      <dc:creator>jpfrancetic</dc:creator>
      <dc:date>2022-03-04T15:09:28Z</dc:date>
    </item>
  </channel>
</rss>

