<?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: split columns with multiple values and make into row in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/split-columns-with-multiple-values-and-make-into-row/m-p/495019#M138022</link>
    <description>&lt;P&gt;Hi surekhasplunk,&lt;BR /&gt;
To split a multivalue field in many row, you can use the mvexpand command (see &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.2/SearchReference/Mvexpand"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.2/SearchReference/Mvexpand&lt;/A&gt; ).&lt;BR /&gt;
To create a multivalue field from a list of values divided by a separator (like your example) you can use  the makemv command (see &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.2/SearchReference/Makemv"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.2/SearchReference/Makemv&lt;/A&gt; ).&lt;BR /&gt;
You can use this command separately (as your first request) or together (like this last request).&lt;/P&gt;

&lt;P&gt;E.g., you could use makemv to create multivalue field and then use mvexpand to split in different events, this only an example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval my_field="FRA-DMZ APP|FRA-DMZ STANDARD MARKET ACCESS|FRA-WEBCELL GBIS"
| makemv delim="|" my_field
| mvexpand my_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 14 Oct 2019 11:00:33 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2019-10-14T11:00:33Z</dc:date>
    <item>
      <title>split columns with multiple values and make into row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/split-columns-with-multiple-values-and-make-into-row/m-p/495016#M138019</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a query output which have many fields out of which only 2 fields have more than one values. &lt;BR /&gt;
So when those fields have more than 1 value i want them to make new row entry with other field values remaining same. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=assets [|inputlookup abc.csv | search "Infrastrucure Name"="*" AND teamInCharge="*" AND type="*"| fields + Nom | rename Nom as name]   | search result="*" AND ruleName="*" | table name  "mgmtAddress.ip" ruleName  policyName  result status | rename "mgmtAddress.ip"  as ip | eval name=upper(name)| lookup abc.csv  Nom as name output "Infrastrucure Name" "teamInCharge"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Output is as shown in the image&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7767iD79C44E8CABAEE61/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I want now 2 different rows as there are 2 Infrastructure names. &lt;/P&gt;

&lt;P&gt;Please help. &lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 15:40:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/split-columns-with-multiple-values-and-make-into-row/m-p/495016#M138019</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2019-10-10T15:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: split columns with multiple values and make into row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/split-columns-with-multiple-values-and-make-into-row/m-p/495017#M138020</link>
      <description>&lt;P&gt;Hi surekhasplunk,&lt;BR /&gt;
did you tried with mvexpand command?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=assets [|inputlookup abc.csv | search "Infrastrucure Name"="*" AND teamInCharge="*" AND type="*"| fields + Nom | rename Nom as name]   result="*" AND ruleName="*" 
| table name  "mgmtAddress.ip" ruleName  policyName  result status 
| rename "mgmtAddress.ip"  as ip 
| eval name=upper(name)
| lookup abc.csv  Nom as name OUTPUT "Infrastrucure Name" "teamInCharge"
| mvexpand "Infrastrucure Name"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 16:01:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/split-columns-with-multiple-values-and-make-into-row/m-p/495017#M138020</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-10T16:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: split columns with multiple values and make into row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/split-columns-with-multiple-values-and-make-into-row/m-p/495018#M138021</link>
      <description>&lt;P&gt;Hi @gcusello,&lt;/P&gt;

&lt;P&gt;I have few more cases where i have the field "Infrastructure Name" look like this "FRA-DMZ APP|FRA-DMZ STANDARD MARKET ACCESS|FRA-WEBCELL GBIS" . They are separated by pipe symbol . Now how to split them into different rows ?&lt;/P&gt;

&lt;P&gt;Please help. &lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 10:31:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/split-columns-with-multiple-values-and-make-into-row/m-p/495018#M138021</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2019-10-14T10:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: split columns with multiple values and make into row</title>
      <link>https://community.splunk.com/t5/Splunk-Search/split-columns-with-multiple-values-and-make-into-row/m-p/495019#M138022</link>
      <description>&lt;P&gt;Hi surekhasplunk,&lt;BR /&gt;
To split a multivalue field in many row, you can use the mvexpand command (see &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.2/SearchReference/Mvexpand"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.2/SearchReference/Mvexpand&lt;/A&gt; ).&lt;BR /&gt;
To create a multivalue field from a list of values divided by a separator (like your example) you can use  the makemv command (see &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.2/SearchReference/Makemv"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.2/SearchReference/Makemv&lt;/A&gt; ).&lt;BR /&gt;
You can use this command separately (as your first request) or together (like this last request).&lt;/P&gt;

&lt;P&gt;E.g., you could use makemv to create multivalue field and then use mvexpand to split in different events, this only an example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval my_field="FRA-DMZ APP|FRA-DMZ STANDARD MARKET ACCESS|FRA-WEBCELL GBIS"
| makemv delim="|" my_field
| mvexpand my_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 11:00:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/split-columns-with-multiple-values-and-make-into-row/m-p/495019#M138022</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-14T11:00:33Z</dc:date>
    </item>
  </channel>
</rss>

