<?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: Eval count in two searches in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Eval-count-in-two-searches/m-p/291347#M162830</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=servers sourcetype=json (appName="*"  AND appName!="*Server*" AND appName!="*Service*") locId=* (level=Warning OR level=Error OR level=Critical OR level=Information)   bdy.msg="Scanner*"
| eval level=if(level="Information",level,"NonInformation")
|  top 50 appName msg bdy.ex.Msg by level showperc=f 
| eval Info=if(level="Information",count,null())
| eval NonInfo=if(level!="Information",count,null())
| stats values(Info) as Info values(NonInfo) as NonInfo by appName msg bdy.ex.Msg
| addcoltotals 
| eval Ratio=Info/NonInfo
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 19 Feb 2018 22:47:25 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-02-19T22:47:25Z</dc:date>
    <item>
      <title>Eval count in two searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-count-in-two-searches/m-p/291346#M162829</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a search that lists top 50 events based on the following search :&lt;/P&gt;

&lt;P&gt;index=servers sourcetype=json appName="&lt;EM&gt;"  AND appName!="*Server&lt;/EM&gt;" AND appName!="&lt;EM&gt;Service&lt;/EM&gt;") locId=* level=Warning OR level=Error OR level=Critical)   bdy.msg="Scanner*"&lt;BR /&gt;
 top 50 appName level msg bdy.ex.Msg | addcoltotals |  fields - percent&lt;/P&gt;

&lt;P&gt;This give me top 50 events with their count. I have another search with slight change :&lt;/P&gt;

&lt;P&gt;index=servers sourcetype=json appName="&lt;EM&gt;"  AND appName!="*Server&lt;/EM&gt;" AND appName!="&lt;EM&gt;Service&lt;/EM&gt;") locId=* level=Information bdy.msg="Scanner*"&lt;BR /&gt;
 top 50 appName level msg bdy.ex.Msg | addcoltotals |  fields - percent&lt;/P&gt;

&lt;P&gt;only thing changing is Level . Now i have to calculate the ratio of both the counts from two searches. how can i do that. any help is highly appreciated.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Rohit&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:05:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-count-in-two-searches/m-p/291346#M162829</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2020-09-29T18:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Eval count in two searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Eval-count-in-two-searches/m-p/291347#M162830</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=servers sourcetype=json (appName="*"  AND appName!="*Server*" AND appName!="*Service*") locId=* (level=Warning OR level=Error OR level=Critical OR level=Information)   bdy.msg="Scanner*"
| eval level=if(level="Information",level,"NonInformation")
|  top 50 appName msg bdy.ex.Msg by level showperc=f 
| eval Info=if(level="Information",count,null())
| eval NonInfo=if(level!="Information",count,null())
| stats values(Info) as Info values(NonInfo) as NonInfo by appName msg bdy.ex.Msg
| addcoltotals 
| eval Ratio=Info/NonInfo
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Feb 2018 22:47:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Eval-count-in-two-searches/m-p/291347#M162830</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-02-19T22:47:25Z</dc:date>
    </item>
  </channel>
</rss>

