<?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 create a multivalue field, based on multiple single value fields with the same field name in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/create-a-multivalue-field-based-on-multiple-single-value-fields/m-p/510159#M142750</link>
    <description>&lt;P&gt;Hi there, I have a bit of a tough one.&lt;/P&gt;&lt;P&gt;I have a log with multiple entries of the same field, basically a list of values. I am trying to merge these values into a single new field, with a line for every value that was in the RAW event.&lt;/P&gt;&lt;P&gt;An example:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2020-07-21T01:52:37+00:00 devicename=device1 | id=a522131 | date=2020-07-21T01:51:20 | name=peter | score=5 | action=read&amp;nbsp;| randomfield1=nothingimportant | score=2 | action=read | score=2 | action=write | score=2 | action=write | randomfield2=nothingimportant&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The intended resulting table where "actions" is a mv field, listing all actions (merging "score" and "action" as well), each on a line, but within the single field (actions):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;name=peter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;actions=&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5:read&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2:read&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2:write&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2:write&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jul 2020 04:37:56 GMT</pubDate>
    <dc:creator>fsiemons</dc:creator>
    <dc:date>2020-07-21T04:37:56Z</dc:date>
    <item>
      <title>create a multivalue field, based on multiple single value fields with the same field name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/create-a-multivalue-field-based-on-multiple-single-value-fields/m-p/510159#M142750</link>
      <description>&lt;P&gt;Hi there, I have a bit of a tough one.&lt;/P&gt;&lt;P&gt;I have a log with multiple entries of the same field, basically a list of values. I am trying to merge these values into a single new field, with a line for every value that was in the RAW event.&lt;/P&gt;&lt;P&gt;An example:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2020-07-21T01:52:37+00:00 devicename=device1 | id=a522131 | date=2020-07-21T01:51:20 | name=peter | score=5 | action=read&amp;nbsp;| randomfield1=nothingimportant | score=2 | action=read | score=2 | action=write | score=2 | action=write | randomfield2=nothingimportant&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The intended resulting table where "actions" is a mv field, listing all actions (merging "score" and "action" as well), each on a line, but within the single field (actions):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;name=peter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;actions=&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5:read&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2:read&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2:write&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2:write&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 04:37:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/create-a-multivalue-field-based-on-multiple-single-value-fields/m-p/510159#M142750</guid>
      <dc:creator>fsiemons</dc:creator>
      <dc:date>2020-07-21T04:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: create a multivalue field, based on multiple single value fields with the same field name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/create-a-multivalue-field-based-on-multiple-single-value-fields/m-p/510233#M142784</link>
      <description>&lt;P&gt;See if this helps.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="2020-07-21T01:52:37+00:00 devicename=device1 | id=a522131 | date=2020-07-21T01:51:20 | name=peter | score=5 | action=read | randomfield1=nothingimportant | score=2 | action=read | score=2 | action=write | score=2 | action=write | randomfield2=nothingimportant"
```Above just creates test data```
| rex "\bname=(?&amp;lt;name&amp;gt;\w+)" 
| rex max_match=0 "score=(?&amp;lt;score&amp;gt;\d+)" 
| rex max_match=0 "action=(?&amp;lt;action&amp;gt;\w+)"
| eval actions=mvzip(score, action, ":")
| table name actions&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 21 Jul 2020 13:20:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/create-a-multivalue-field-based-on-multiple-single-value-fields/m-p/510233#M142784</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-21T13:20:17Z</dc:date>
    </item>
  </channel>
</rss>

