<?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: How to expand/extract multivalue fields line by line? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/604118#M210146</link>
    <description>&lt;LI-CODE lang="markup"&gt;| eval range=mvrange(0,mvcount(Skills))
| mvexpand range
| eval Skills=mvindex(Skills,range)
| eval SkillLevel=mvindex(SkillLevel,range)
| eval Hours=mvindex(Hours,range)
| fields - range&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 01 Jul 2022 12:24:30 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-07-01T12:24:30Z</dc:date>
    <item>
      <title>How to expand/extract multivalue fields line by line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/603556#M210015</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I have 3 multivalue fields (max. 3 values per field) and I want to expand/extract them to single values. Data looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timo258_0-1656410219678.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20334i7B85A4C8A95973C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="timo258_0-1656410219678.png" alt="timo258_0-1656410219678.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I use | mvexpand Splunk extracts to all skills, all skillLevels with all skill hours:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timo258_2-1656410912449.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20336iA89B45C8BFC8CD79/image-size/medium?v=v2&amp;amp;px=400" role="button" title="timo258_2-1656410912449.png" alt="timo258_2-1656410912449.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How can I tell splunk to extract only line by line?&amp;nbsp;&lt;BR /&gt;Result should look like:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;Skill&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;SkillLevel&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;Hours&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Hardware-Techniker&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;3 Advanced&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;SPAN&gt;Software-Entwickler Sonderprogramme (C, C++)&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;3 Advanced&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Query: (without | mvexpand)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Skills = mvappend(customfield_26202_child_value, customfield_26204_child_value, customfield_26205_child_value)
| eval SkillLevel = mvappend(customfield_26206_value, customfield_26207_value, customfield_26208_value)
| eval Hours = mvappend(customfield_26300, customfield_26301, customfield_26302)
| table Skills,SkillLevel,Hours&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 10:17:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/603556#M210015</guid>
      <dc:creator>timo258</dc:creator>
      <dc:date>2022-06-28T10:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand/extract multivalue fields line by line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/603558#M210016</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247151"&gt;@timo258&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After the mvexpand you could try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| stats sum(Hours) as Hours_total by Skill SkillLevel&lt;BR /&gt;| stats list(Skill) list(SkillLevel) by Hours_total&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then use table and/or rename as you need to get the correct order and name of columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jamie&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 10:28:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/603558#M210016</guid>
      <dc:creator>jamie00171</dc:creator>
      <dc:date>2022-06-28T10:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand/extract multivalue fields line by line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/603561#M210017</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247151"&gt;@timo258&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you should see the mvexpand command (&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.0/SearchReference/Mvexpand" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.0/SearchReference/Mvexpand&lt;/A&gt;) and try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index
| mvexpand Skill
| stats sum(Hours) AS Hours values(skillLevel) AS skillLevels BY Skill&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 11:00:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/603561#M210017</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-06-28T11:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand/extract multivalue fields line by line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/603566#M210019</link>
      <description>&lt;P&gt;Hi Jamie,&lt;/P&gt;&lt;P&gt;Thank you for your answer!&lt;/P&gt;&lt;P&gt;The problem with your is, if I do a:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| stats sum(Hours)&lt;/PRE&gt;&lt;P&gt;Splunk will sum up all hours in that field:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timo258_0-1656414887732.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20337iD6BD52832C48D746/image-size/medium?v=v2&amp;amp;px=400" role="button" title="timo258_0-1656414887732.png" alt="timo258_0-1656414887732.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 11:16:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/603566#M210019</guid>
      <dc:creator>timo258</dc:creator>
      <dc:date>2022-06-28T11:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand/extract multivalue fields line by line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/603568#M210020</link>
      <description>&lt;P&gt;Hi &lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;Thank you for your answer!&lt;/P&gt;&lt;P&gt;The problem with your solution is, if I do a:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| stats sum(Hours)&lt;/PRE&gt;&lt;P&gt;Splunk will sum up all hours in that field:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timo258_0-1656415147581.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20338iE7A20017ED86A270/image-size/medium?v=v2&amp;amp;px=400" role="button" title="timo258_0-1656415147581.png" alt="timo258_0-1656415147581.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 11:19:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/603568#M210020</guid>
      <dc:creator>timo258</dc:creator>
      <dc:date>2022-06-28T11:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand/extract multivalue fields line by line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/603570#M210021</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247151"&gt;@timo258&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the problem is that multivales field are ordered in alphabetical order on the single field, in other words, the first value of the first multivale isn't sure that it's corresponding to the first value of the second field.&lt;/P&gt;&lt;P&gt;How do you arrived to this multivalues? are they the result of a stats command or are they in the row events?&lt;/P&gt;&lt;P&gt;in the fist case ,please share the code, in the second, please share some sample of your events.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 11:27:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/603570#M210021</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-06-28T11:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand/extract multivalue fields line by line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/603599#M210027</link>
      <description>&lt;P&gt;Hi Giuseppe,&lt;/P&gt;&lt;P&gt;raw data is a&amp;nbsp; huge json file with events like this: (separated by "key" field)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "customfield_26300" : 10.0,
  "customfield_26302" : null,
  "customfield_26301" : 15.0,
  "customfield_26202" : {
    "child" : {
      "value" : "Hardware-Techniker"
    }
  },
  "customfield_26204" : {
    "child" : {
      "value" : "Software-Entwickler Sonderprogramme (C, C++)"
    }
  },
  "key" : "PBWP-4881",
  "customfield_26207" : {
    "value" : "3 Advanced"
  },
  "customfield_26206" : {
    "value" : "3 Advanced"
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;customfield_26202 and&amp;nbsp;customfield_26204 has the same content and I have to merge/append them together.&amp;nbsp; Same for customfield_26027 and 26206 etc.&lt;BR /&gt;That is why I did this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Skills = mvappend(customfield_26202_child_value, customfield_26204_child_value, customfield_26205_child_value)
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did some tests, Splunk is taking the order from mvappend() function&lt;SPAN&gt;. I think it is not alphabetical.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any ideas how I can achieve&amp;nbsp;that:&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;Skill&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;SkillLevel&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;Hours&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Hardware-Techniker&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;3 Advanced&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;SPAN&gt;Software-Entwickler Sonderprogramme (C, C++)&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;3 Advanced&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 14:38:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/603599#M210027</guid>
      <dc:creator>timo258</dc:creator>
      <dc:date>2022-06-28T14:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand/extract multivalue fields line by line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/604118#M210146</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval range=mvrange(0,mvcount(Skills))
| mvexpand range
| eval Skills=mvindex(Skills,range)
| eval SkillLevel=mvindex(SkillLevel,range)
| eval Hours=mvindex(Hours,range)
| fields - range&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 01 Jul 2022 12:24:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/604118#M210146</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-07-01T12:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to expand/extract multivalue fields line by line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/604129#M210150</link>
      <description>&lt;P&gt;Works just perfect! Thank you very much!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 13:40:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-expand-extract-multivalue-fields-line-by-line/m-p/604129#M210150</guid>
      <dc:creator>timo258</dc:creator>
      <dc:date>2022-07-01T13:40:11Z</dc:date>
    </item>
  </channel>
</rss>

