<?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: Adding  Integers/numerical data in 2 multivalue fields to a new field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560922#M159428</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236743"&gt;@jaysonpryde&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please share sample OP from this ?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH | head 3
| table Field1	Field2 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jul 2021 05:57:08 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2021-07-27T05:57:08Z</dc:date>
    <item>
      <title>Adding  Integers/numerical data in 2 multivalue fields to a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560894#M159414</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I think the subject of my questions says it all... I wanted to add numerical data from &lt;STRONG&gt;2 multivalue fields&lt;/STRONG&gt;, and save it to a new field.&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Field1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Field2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Field3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;4&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;8&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;8&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;9&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;17&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know mvappend is not the one to be used here, but I already tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;| eval field3=mvappend(field1,field2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas are greatly appreciated?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 03:27:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560894#M159414</guid>
      <dc:creator>jaysonpryde</dc:creator>
      <dc:date>2021-07-27T03:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Adding  Integers/numerical data in 2 multivalue fields to a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560913#M159422</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236743"&gt;@jaysonpryde&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you looking for this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH
| eval a=1 | accum a
| stats sum(Field1) as sum_Field1 sum(Field2) as sum_Field2 list(*) as * by a
| eval Field3= sum_Field1+sum_Field2 | fields Field*&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Sample Search :&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="Field1	Field2
4|2	8|5	12
8|2	9|2	17
3|2	2|2	5" | multikv forceheader=1 | eval Field1=split(Field1,"|"),Field2=split(Field2,"|")
| table Field1	Field2 
| rename comment as "Upto Now is sample data only" 
| eval a=1 | accum a
| stats sum(Field1) as sum_Field1 sum(Field2) as sum_Field2 list(*) as * by a
| eval Field3= sum_Field1+sum_Field2 | fields Field*&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一 &amp;nbsp; ?&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 04:41:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560913#M159422</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-27T04:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Adding  Integers/numerical data in 2 multivalue fields to a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560914#M159423</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;, thanks a lot for your feedback.&lt;/P&gt;&lt;P&gt;However,&amp;nbsp; your proposed solution is actually getting the sum of Field1 and Field2.&lt;/P&gt;&lt;P&gt;I am not up to that. As mentioned, I want each row/entry of the the multivalue fields 1 &amp;amp; 2, to be added, and saved on fied 3... Again, what I require is a per entry operation.&lt;/P&gt;&lt;P&gt;Again, thanks a lot for your reply.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 04:53:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560914#M159423</guid>
      <dc:creator>jaysonpryde</dc:creator>
      <dc:date>2021-07-27T04:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Adding  Integers/numerical data in 2 multivalue fields to a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560915#M159424</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236743"&gt;@jaysonpryde&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you said multivalued ( single field with multiple values) field so I though field1 and field2 is multivalued.&lt;/P&gt;&lt;P&gt;As per your provided example in question, did you tried simply addition?&lt;/P&gt;&lt;P&gt;&amp;nbsp;like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval field3=field1 + field2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or I think I'm still not clear about your expectations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 05:09:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560915#M159424</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-27T05:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Adding  Integers/numerical data in 2 multivalue fields to a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560916#M159425</link>
      <description>&lt;P&gt;Hmm... the solution you provided is not working for me. I always get empty results in field3&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 05:14:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560916#M159425</guid>
      <dc:creator>jaysonpryde</dc:creator>
      <dc:date>2021-07-27T05:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Adding  Integers/numerical data in 2 multivalue fields to a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560917#M159426</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Field3=tonumber(Field1) + tonumber(Field2)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Jul 2021 05:16:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560917#M159426</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-27T05:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Adding  Integers/numerical data in 2 multivalue fields to a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560921#M159427</link>
      <description>&lt;P&gt;still not working... I think you can't just simply add multivalue fields directly.&lt;/P&gt;&lt;P&gt;But still, thanks a lot for your comments. greatly appreciate it&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 05:55:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560921#M159427</guid>
      <dc:creator>jaysonpryde</dc:creator>
      <dc:date>2021-07-27T05:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Adding  Integers/numerical data in 2 multivalue fields to a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560922#M159428</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236743"&gt;@jaysonpryde&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please share sample OP from this ?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH | head 3
| table Field1	Field2 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 05:57:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560922#M159428</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-27T05:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Adding  Integers/numerical data in 2 multivalue fields to a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560926#M159429</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="example field1 and field2" style="width: 200px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15264iF227A5FFA9B8FB7B/image-size/small?v=v2&amp;amp;px=200" role="button" title="Screen Shot 2021-07-27 at 2.07.03 PM.png" alt="example field1 and field2" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;example field1 and field2&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Like what I placed in my initial post, it's just 2 multivalue fields.&lt;/P&gt;&lt;P&gt;I got the 2 multivalue fields from this search:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;| stats list(field1) as field1, list(field2) as field2 by group_name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 06:13:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560926#M159429</guid>
      <dc:creator>jaysonpryde</dc:creator>
      <dc:date>2021-07-27T06:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Adding  Integers/numerical data in 2 multivalue fields to a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560928#M159430</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236743"&gt;@jaysonpryde&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is is possible to add before stats? like&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH
| eval field3 = field1 + field2
| stats list(field1) as field1, list(field2) as field2,list(field3) as field3 by group_name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="field1,field2,group_name
4,8,A
8,9,A
3,2,A" 
| multikv forceheader=1 
| rename comment as "Upto Now is sample data only" 
| eval field3 = field1 + field2
| stats list(field1) as field1, list(field2) as field2,list(field3) as field3 by group_name&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Jul 2021 06:22:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560928#M159430</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-27T06:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Adding  Integers/numerical data in 2 multivalue fields to a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560929#M159431</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval field3=mvzip(field1,field2,"!")
| eval field3=mvmap(field3,tonumber(mvindex(split(field3,"!"),0))+tonumber(mvindex(split(field3,"!"),1)))&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Jul 2021 06:24:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560929#M159431</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-27T06:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Adding  Integers/numerical data in 2 multivalue fields to a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560937#M159433</link>
      <description>&lt;P&gt;not possible since field1 and field2 are results from operations / evaluations.&lt;/P&gt;&lt;P&gt;I just simplified it on my original post.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 06:38:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560937#M159433</guid>
      <dc:creator>jaysonpryde</dc:creator>
      <dc:date>2021-07-27T06:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Adding  Integers/numerical data in 2 multivalue fields to a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560941#M159434</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/236743"&gt;@jaysonpryde&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I think this will help you.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH
| stats list(field1) as field1, list(field2) as field2 by group_name
| eval t=mvzip(field1,field2)
| mvexpand t
| eval field1=mvindex(split(t,","),0),field2=mvindex(split(t,","),0) | fields - t
| eval field3 = field1 + field2
| stats list(field1) as field1, list(field2) as field2, list(field3) as field3 by group_name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Sample Search :&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="field1,field2,group_name
4,8,A
8,9,A
3,2,A" 
| multikv forceheader=1 
| rename comment as "Upto Now is sample data only" 
| stats list(field1) as field1, list(field2) as field2 by group_name
| eval t=mvzip(field1,field2)
| mvexpand t
| eval field1=mvindex(split(t,","),0),field2=mvindex(split(t,","),0) | fields - t
| eval field3 = field1 + field2
| stats list(field1) as field1, list(field2) as field2, list(field3) as field3 by group_name&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Jul 2021 06:45:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/560941#M159434</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-07-27T06:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Adding  Integers/numerical data in 2 multivalue fields to a new field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/561147#M159494</link>
      <description>&lt;P&gt;You're indeed a legend&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;. Thank you very much!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 06:10:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Adding-Integers-numerical-data-in-2-multivalue-fields-to-a-new/m-p/561147#M159494</guid>
      <dc:creator>jaysonpryde</dc:creator>
      <dc:date>2021-07-28T06:10:53Z</dc:date>
    </item>
  </channel>
</rss>

