<?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: Subtraction of multiple values in same cell in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-multiple-values-in-same-cell/m-p/557832#M158425</link>
    <description>&lt;P&gt;Hey, thank you for your reply. However I get the following error &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt; Error in 'eval' command: Type checking failed. '-' only takes numbers.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Jun 2021 14:57:25 GMT</pubDate>
    <dc:creator>shivaa</dc:creator>
    <dc:date>2021-06-30T14:57:25Z</dc:date>
    <item>
      <title>Subtraction of multiple values in same cell</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-multiple-values-in-same-cell/m-p/557810#M158420</link>
      <description>&lt;P&gt;So I’m pretty new to splunk and I do feel like this should be a lot simpler than I’m making it.&lt;/P&gt;&lt;P&gt;I need two epoch times that are in the same cell to be substracted from each other and I haven’t been able to find anything that can help with it or figure it out myself. I didn't want to use mvexpand because I want the subtraction to be based off of the user&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My search result looks like this rn:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Name&lt;/TD&gt;&lt;TD width="50%"&gt;Epoch&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;UserA&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;P&gt;1625037039&lt;/P&gt;&lt;P&gt;1625037045&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;UserB&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;P&gt;1625050381&lt;/P&gt;&lt;P&gt;1625050423&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 13:03:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-multiple-values-in-same-cell/m-p/557810#M158420</guid>
      <dc:creator>shivaa</dc:creator>
      <dc:date>2021-06-30T13:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of multiple values in same cell</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-multiple-values-in-same-cell/m-p/557812#M158421</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval epoch=mvindex(epoch,1)-mvindex(epoch,0)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 30 Jun 2021 13:24:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-multiple-values-in-same-cell/m-p/557812#M158421</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-06-30T13:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of multiple values in same cell</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-multiple-values-in-same-cell/m-p/557832#M158425</link>
      <description>&lt;P&gt;Hey, thank you for your reply. However I get the following error &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt; Error in 'eval' command: Type checking failed. '-' only takes numbers.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 14:57:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-multiple-values-in-same-cell/m-p/557832#M158425</guid>
      <dc:creator>shivaa</dc:creator>
      <dc:date>2021-06-30T14:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of multiple values in same cell</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-multiple-values-in-same-cell/m-p/557836#M158427</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234238"&gt;@shivaa&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH
| eval Epoch=tonumber(mvindex(Epoch,1)) - tonumber(mvindex(Epoch,0))&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="Name	Epoch
UserA	1625037039|1625037045
UserB	1625050381|1625050423"
| multikv forceheader=1
| eval Epoch=split(Epoch,"|")
| table Name Epoch
| rename comment as "Upto Now is sample data only" 
| eval Epoch=tonumber(mvindex(Epoch,1)) - tonumber(mvindex(Epoch,0))&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一&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>Wed, 30 Jun 2021 15:03:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-multiple-values-in-same-cell/m-p/557836#M158427</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-30T15:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Subtraction of multiple values in same cell</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-multiple-values-in-same-cell/m-p/557980#M158469</link>
      <description>&lt;P&gt;worked like a charm, thank you so much! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 06:14:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subtraction-of-multiple-values-in-same-cell/m-p/557980#M158469</guid>
      <dc:creator>shivaa</dc:creator>
      <dc:date>2021-07-01T06:14:13Z</dc:date>
    </item>
  </channel>
</rss>

