<?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: I am getting the Error in 'eval' command: Type checking failed. '-' only takes numbers, while calculating difference in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/I-am-getting-the-Error-in-eval-command-Type-checking-failed-only/m-p/557785#M158415</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170299"&gt;@dtccsundar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please change your eval with this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval "Pass % diff"=round('dbyest Pass %'-'yest Pass %') &lt;/LI-CODE&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Jun 2021 11:13:13 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2021-06-30T11:13:13Z</dc:date>
    <item>
      <title>I am getting the Error in 'eval' command: Type checking failed. '-' only takes numbers, while calculating difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-am-getting-the-Error-in-eval-command-Type-checking-failed-only/m-p/557782#M158414</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;My wish to get the difference between yesterday and todays Pass % and fail % for different sourcetypes .&lt;/P&gt;&lt;P&gt;I have tried as below ,&lt;/P&gt;&lt;P&gt;index=x1 sourcetype=y1 OR sourcetype=y2 OR sourcetype=y3 OR sourcetype=y4 OR sourcetype=y5 OR sourcetype=y6 OR sourcetype=y7 earliest=-48h@h latest=-24h@h|chart count over sourcetype by Status|addtotals|eval "dbyest Pass %"=round((Pass/Total)*100,3) |eval "dbyest Fail %"=round((Fail/Total)*100,3) |stats count by sourcetype "dbyest Pass %" "dbyest Fail %" |rename Total as "Total Scope"|eval repo="dbyest"&lt;/P&gt;&lt;P&gt;|append&lt;/P&gt;&lt;P&gt;[search index=x1 sourcetype=y1 OR sourcetype=y2 OR sourcetype=y3 OR sourcetype=y4 OR sourcetype=y5 OR sourcetype=y6 OR sourcetype=y7 earliest=-48h@h latest=-24h@h|chart count over sourcetype by Status|addtotals|eval "yest Pass %"=round((Pass/Total)*100,3) |eval "yest Fail %"=round((Fail/Total)*100,3) |stats count by sourcetype "yest Pass %" "yest Fail %" |rename Total as "Total Scope"|eval repo="yest"]&lt;/P&gt;&lt;P&gt;|eval "Pass % diff"=round("dbyest Pass %"-"yest Pass %")|table "dbyest Pass %" "dbyest Fail %" "yest Pass %" "yest Fail %" "Pass % diff"&lt;/P&gt;&lt;P&gt;When i ran this , i am getting the error "&lt;STRONG&gt;Error in 'eval' command: Type checking failed. '-' only takes numbers."&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please help me in this to get the difference ?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 11:01:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-am-getting-the-Error-in-eval-command-Type-checking-failed-only/m-p/557782#M158414</guid>
      <dc:creator>dtccsundar</dc:creator>
      <dc:date>2021-06-30T11:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting the Error in 'eval' command: Type checking failed. '-' only takes numbers, while calculating difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-am-getting-the-Error-in-eval-command-Type-checking-failed-only/m-p/557785#M158415</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170299"&gt;@dtccsundar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please change your eval with this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval "Pass % diff"=round('dbyest Pass %'-'yest Pass %') &lt;/LI-CODE&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 11:13:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-am-getting-the-Error-in-eval-command-Type-checking-failed-only/m-p/557785#M158415</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-30T11:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting the Error in 'eval' command: Type checking failed. '-' only takes numbers, while calculating difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-am-getting-the-Error-in-eval-command-Type-checking-failed-only/m-p/557796#M158416</link>
      <description>&lt;P&gt;&lt;SPAN&gt;kamlesh_vaghela&amp;nbsp; Thanks for your reply !!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But i am not seeing any value in the table command for "Pass % diff" after that .Can you please provide any other solution for this .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 12:14:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-am-getting-the-Error-in-eval-command-Type-checking-failed-only/m-p/557796#M158416</guid>
      <dc:creator>dtccsundar</dc:creator>
      <dc:date>2021-06-30T12:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting the Error in 'eval' command: Type checking failed. '-' only takes numbers, while calculating difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-am-getting-the-Error-in-eval-command-Type-checking-failed-only/m-p/557800#M158417</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170299"&gt;@dtccsundar&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;index=x1 sourcetype=y1 OR sourcetype=y2 OR sourcetype=y3 OR sourcetype=y4 OR sourcetype=y5 OR sourcetype=y6 OR sourcetype=y7 earliest=-48h@h latest=-24h@h 
| chart count over sourcetype by Status 
| addtotals 
| eval dbyest_Pass=round((Pass/Total)*100,3) 
| eval dbyest_Fail=round((Fail/Total)*100,3) 
| stats count by sourcetype dbyest_Pass dbyest_Fail 
| rename Total as "Total Scope" 
| eval repo="dbyest" 
| append 
    [ search index=x1 sourcetype=y1 OR sourcetype=y2 OR sourcetype=y3 OR sourcetype=y4 OR sourcetype=y5 OR sourcetype=y6 OR sourcetype=y7 earliest=-48h@h latest=-24h@h 
    | chart count over sourcetype by Status 
    | addtotals 
    | eval yest_Pass=round((Pass/Total)*100,3) 
    | eval yest_Fail=round((Fail/Total)*100,3) 
    | stats count by sourcetype yest_Pass yest_Fail 
    | rename Total as "Total Scope" 
    | eval repo="yest"] 
| eval Pass_diff=round(dbyest_Pass-yest_Pass)
| rename yest_Pass as "yest Pass %",yest_Fail as "yest Fail %", dbyest_Fail as "dbyest Fail %", dbyest_Pass as "dbyest Pass %", Pass_diff as "Pass % diff"
| table "dbyest Pass %" "dbyest Fail %" "yest Pass %" "yest Fail %" "Pass % diff"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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 12:41:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-am-getting-the-Error-in-eval-command-Type-checking-failed-only/m-p/557800#M158417</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-30T12:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: I am getting the Error in 'eval' command: Type checking failed. '-' only takes numbers, while calculating difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/I-am-getting-the-Error-in-eval-command-Type-checking-failed-only/m-p/557808#M158419</link>
      <description>&lt;P&gt;Thanks for your reply KV .&lt;/P&gt;&lt;P&gt;I got it by changing ,&lt;/P&gt;&lt;P&gt;| eval "dbyest Pass %"=round((Pass/Total)*100,3)&lt;/P&gt;&lt;P&gt;&amp;nbsp; as&amp;nbsp;&lt;/P&gt;&lt;P&gt;| eval "dbyest Pass%"=round(('Pass'/Total)*100,3)&amp;nbsp;&lt;/P&gt;&lt;P&gt;and that worked .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 12:55:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/I-am-getting-the-Error-in-eval-command-Type-checking-failed-only/m-p/557808#M158419</guid>
      <dc:creator>dtccsundar</dc:creator>
      <dc:date>2021-06-30T12:55:43Z</dc:date>
    </item>
  </channel>
</rss>

