<?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 How can i create new fields with data from two different multi value fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-i-create-new-fields-with-data-from-two-different-multi/m-p/658036#M227294</link>
    <description>&lt;P&gt;I need to break out log data from two separate multi-value fields into single value fields. Here is what data looks like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-09-19 at 12.00.11 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27235iF5ADE87E710C5D5D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-09-19 at 12.00.11 PM.png" alt="Screenshot 2023-09-19 at 12.00.11 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; Each line of data from&amp;nbsp;"participants{}.object_value" corresponds to the line in "participants{}.role" and I would like named victims and offender fields.&amp;nbsp; I dont understand how to use the mv commands to expand the data from two different fields and then combine them into new fields.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Sep 2023 17:14:50 GMT</pubDate>
    <dc:creator>mauricio_sandov</dc:creator>
    <dc:date>2023-09-19T17:14:50Z</dc:date>
    <item>
      <title>How can i create new fields with data from two different multi value fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-i-create-new-fields-with-data-from-two-different-multi/m-p/658036#M227294</link>
      <description>&lt;P&gt;I need to break out log data from two separate multi-value fields into single value fields. Here is what data looks like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-09-19 at 12.00.11 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27235iF5ADE87E710C5D5D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-09-19 at 12.00.11 PM.png" alt="Screenshot 2023-09-19 at 12.00.11 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; Each line of data from&amp;nbsp;"participants{}.object_value" corresponds to the line in "participants{}.role" and I would like named victims and offender fields.&amp;nbsp; I dont understand how to use the mv commands to expand the data from two different fields and then combine them into new fields.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 17:14:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-i-create-new-fields-with-data-from-two-different-multi/m-p/658036#M227294</guid>
      <dc:creator>mauricio_sandov</dc:creator>
      <dc:date>2023-09-19T17:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can i create new fields with data from two different multi value fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-i-create-new-fields-with-data-from-two-different-multi/m-p/658039#M227297</link>
      <description>&lt;P&gt;Once multi-value fields are expanded, any relationship among them is lost.&amp;nbsp; They need to be combined into a new field before expansion.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| eval new_field = mvzip("participants{}.object_value", "participants{}.role")
| mvexpand new_field
| eval new_field = split(new_field, ",")
| eval object_value = mvindex(new_field, 0), role = mvindex(new_field, 1)&lt;/LI-CODE&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;mvzip&lt;/FONT&gt; function combines two multi-value fields, separating them with a comma.&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;split&lt;/FONT&gt; function later on breaks the field on the comma.&amp;nbsp; If you have more than two fields to combine, use nested mvzip functions.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval new_field = mvzip(field1, mvzip(field2, mvzip(field3, field4)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 17:28:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-i-create-new-fields-with-data-from-two-different-multi/m-p/658039#M227297</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-09-19T17:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can i create new fields with data from two different multi value fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-i-create-new-fields-with-data-from-two-different-multi/m-p/658621#M227493</link>
      <description>&lt;P&gt;I will give this a shot to see what I get. thx&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 16:00:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-i-create-new-fields-with-data-from-two-different-multi/m-p/658621#M227493</guid>
      <dc:creator>mauricio_sandov</dc:creator>
      <dc:date>2023-09-25T16:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can i create new fields with data from two different multi value fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-i-create-new-fields-with-data-from-two-different-multi/m-p/658627#M227495</link>
      <description>&lt;P&gt;Thank you this worked and did what I needed&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 16:59:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-i-create-new-fields-with-data-from-two-different-multi/m-p/658627#M227495</guid>
      <dc:creator>mauricio_sandov</dc:creator>
      <dc:date>2023-09-25T16:59:14Z</dc:date>
    </item>
  </channel>
</rss>

