<?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: Ratio of total number Informational events and events with certain keywords into it in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Ratio-of-total-number-Informational-events-and-events-with/m-p/384363#M6399</link>
    <description>&lt;P&gt;sorry for the type, in the main query the command should be eventstats not streamstats, which is also not working&lt;/P&gt;</description>
    <pubDate>Mon, 07 May 2018 18:46:54 GMT</pubDate>
    <dc:creator>macadminrohit</dc:creator>
    <dc:date>2018-05-07T18:46:54Z</dc:date>
    <item>
      <title>Ratio of total number Informational events and events with certain keywords into it</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Ratio-of-total-number-Informational-events-and-events-with/m-p/384362#M6398</link>
      <description>&lt;P&gt;My query is like this, here eventstats is not doing what it is supposed to do.&lt;/P&gt;

&lt;P&gt;index=servers sourcetype=xs_json | rename hdr.level as LEVEL&lt;BR /&gt;&lt;BR /&gt;
| stats count(eval(searchmatch("not available"))) as ERROR_COUNT | streamstats count(eval(LEVEL="Information")) as INFO | eval RATIO=(INFO/ERROR_COUNT)&lt;/P&gt;

&lt;P&gt;I am getting the values for ERROR_COUNT by not for the field INFO. But when i run stats on count(eval(LEVEL="Information")) as INFO i can see the values but not with eventstats.&lt;/P&gt;

&lt;P&gt;Basically i want a ratio as seen in the above query. Ratio of TOTAL number of messages divided by the number of events in which "not available" was present.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:26:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Ratio-of-total-number-Informational-events-and-events-with/m-p/384362#M6398</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2020-09-29T19:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio of total number Informational events and events with certain keywords into it</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Ratio-of-total-number-Informational-events-and-events-with/m-p/384363#M6399</link>
      <description>&lt;P&gt;sorry for the type, in the main query the command should be eventstats not streamstats, which is also not working&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 18:46:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Ratio-of-total-number-Informational-events-and-events-with/m-p/384363#M6399</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2018-05-07T18:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio of total number Informational events and events with certain keywords into it</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Ratio-of-total-number-Informational-events-and-events-with/m-p/384364#M6400</link>
      <description>&lt;P&gt;I even tried appendcols but it doesnt work. Always getting the value for INFO as 0. &lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 18:57:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Ratio-of-total-number-Informational-events-and-events-with/m-p/384364#M6400</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2018-05-07T18:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio of total number Informational events and events with certain keywords into it</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Ratio-of-total-number-Informational-events-and-events-with/m-p/384365#M6401</link>
      <description>&lt;P&gt;I need a timechart of the ratio.&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 19:04:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Ratio-of-total-number-Informational-events-and-events-with/m-p/384365#M6401</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2018-05-07T19:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio of total number Informational events and events with certain keywords into it</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Ratio-of-total-number-Informational-events-and-events-with/m-p/384366#M6402</link>
      <description>&lt;P&gt;If the Total Event count is all events, including error events (to calculate ratio of all vs errors), try like this (showing hourly timechart, adjust span per your need)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=servers sourcetype=xs_json | rename hdr.level as LEVEL 
| eval isError=if(searchmatch("not available"),1,0)
| timechart span=1h sum(isError) as ERROR_COUNT count as TOTAL_COUNT
| eval RATIO=round(TOTAL_COUNT/ERROR_COUNT,2) | table _time RATIO
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If the Total Event count is all INFO events, NOT including error events (to calculate ratio of info vs errors), try like this (showing hourly timechart, adjust span per your need)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=servers sourcetype=xs_json | rename hdr.level as LEVEL 
| eval isError=if(searchmatch("not available"),1,0)
| eval isInfo=if(LEVEL="Information",1,0)
| timechart span=1h sum(isError) as ERROR_COUNT sum(isInfo) as INFO_COUNT
| eval RATIO=round(INFO_COUNT/ERROR_COUNT,2) | table _time RATIO
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 May 2018 20:12:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Ratio-of-total-number-Informational-events-and-events-with/m-p/384366#M6402</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-07T20:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Ratio of total number Informational events and events with certain keywords into it</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Ratio-of-total-number-Informational-events-and-events-with/m-p/384367#M6403</link>
      <description>&lt;P&gt;the query is still running as i am getting 30 days data, any idea why eventstats didnt work?&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 21:18:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Ratio-of-total-number-Informational-events-and-events-with/m-p/384367#M6403</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2018-05-07T21:18:46Z</dc:date>
    </item>
  </channel>
</rss>

