<?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: Dynamic variable fields generation in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Dynamic-variable-fields-generation/m-p/518464#M145799</link>
    <description>&lt;P&gt;Thanks a lot both answer solved my problem&lt;/P&gt;</description>
    <pubDate>Tue, 08 Sep 2020 14:56:06 GMT</pubDate>
    <dc:creator>victorsalazar</dc:creator>
    <dc:date>2020-09-08T14:56:06Z</dc:date>
    <item>
      <title>Dynamic variable fields generation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dynamic-variable-fields-generation/m-p/517977#M145685</link>
      <description>&lt;P&gt;Hello Splunk Community&lt;/P&gt;&lt;P&gt;I would like to know if I can create a new column field from a multivalue field&lt;BR /&gt;&lt;BR /&gt;MV field =&amp;nbsp;&lt;/P&gt;&lt;P&gt;1, 2, 3, 4&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I have another MV field&lt;/P&gt;&lt;P&gt;a, b,c,d&amp;nbsp;&lt;/P&gt;&lt;P&gt;after that I want my search result to look like in the picture&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="q_splunk.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/10657iB3D91B2ED812F8FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="q_splunk.png" alt="q_splunk.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2020 20:28:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dynamic-variable-fields-generation/m-p/517977#M145685</guid>
      <dc:creator>victorsalazar</dc:creator>
      <dc:date>2020-09-04T20:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic variable fields generation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dynamic-variable-fields-generation/m-p/517983#M145686</link>
      <description>&lt;P&gt;You already have two MV fields so it's not clear what field you want to create.&lt;/P&gt;&lt;P&gt;To produce the example output from the example inputs, try this query.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval x="1,2,3,4", y="a,b,c,d" | eval x=split(x,","), y=split(y,",")
```The above just generates test data```
| eval z=mvzip(y,x)
| mvexpand z
| eval z=split(z,",") | eval h=mvindex(z,0), v=mvindex(z,1)
| fields h,v
| fields - _*
| transpose header_field=h
| fields - column&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 04 Sep 2020 20:52:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dynamic-variable-fields-generation/m-p/517983#M145686</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-09-04T20:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic variable fields generation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dynamic-variable-fields-generation/m-p/517984#M145687</link>
      <description>&lt;P&gt;mvzip the two mv fields together, mvexpand to split into multiple events, rex out the two values, eval a new field using one field value for the name and the other field for the value, then use stats to join the events back together&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats count as event_no
| eval combined=mvzip(field1, field2)
| mvexpand combined
| rex field=combined "(?&amp;lt;key&amp;gt;[^,]*),(?&amp;lt;value&amp;gt;.*)"
| eval {key}=value
| stats values(*) as * by event_no&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 04 Sep 2020 20:56:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dynamic-variable-fields-generation/m-p/517984#M145687</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-04T20:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic variable fields generation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Dynamic-variable-fields-generation/m-p/518464#M145799</link>
      <description>&lt;P&gt;Thanks a lot both answer solved my problem&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 14:56:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Dynamic-variable-fields-generation/m-p/518464#M145799</guid>
      <dc:creator>victorsalazar</dc:creator>
      <dc:date>2020-09-08T14:56:06Z</dc:date>
    </item>
  </channel>
</rss>

